C ++ study notes data structures (stacks and queues, linked lists)

Abstract:
After the stack, first-out queue is first in first out

Here are some basic operations of the interface stacks and queues

  1. Stack stack
stack.size()  栈的大小
stack.empty() 栈是否为空
stack.push(a)  将a插入栈顶
stack.pop()  弹出栈顶元素(删除栈顶元素)
stack.top()  引用栈顶对象 

2. queue queue

queue.size()  队列的大小
queue.empty()  队列是否为空
queue.enqueue(a) 将a插入队尾
queue.dequeue()   删除队首对象
queue.front()  引用队首对象

3. For chain
neither get its information length (size) can not be directly through the index scale
so only through a calculation to find a length which
at the same time looking for such an element also need to find the count

Published 44 original articles · won praise 9 · views 3361

Guess you like

Origin blog.csdn.net/puying1/article/details/103098038