栈
Data Structures & Algorithms · 3 notes
- Stack with a min Functionhistorical
Define a stack data structure and implement a min function in this type that can obtain the minimum element contained in the stack, with O(1) time complexity.
- Stack Push and Pop Sequenceshistorical
Given two integer sequences, the first sequence represents the push order of a stack. Determine whether the second sequence could be a pop order of that stack.
- Implement a Queue with Two Stackshistorical
Use two stacks to implement a queue and complete the queue's Push and Pop operations. The elements in the queue are of type int.