List, Stack, and Queue
生活随笔
收集整理的這篇文章主要介紹了
List, Stack, and Queue
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
From:《Data Structures and Algorithm Analysis in C++》 chapter 3 This chapter discusses three of the most simple and basic data structures.
I will :
I will :
- Introduce the concept of Abstract Data Types.
- Show how to efficiently perform operatioins on lists.
- Introduce the stack ADT
- Introduce the queue ADT
- ?Object : such as list, set, graphs, integer, real, boolean...
- ?Operation: such as find, remove, insert, get....
- printList is carried out in linear time;
- findKth takes constant time;
- insertion and deletion are potentially expensive, depending on where the insertions and deletetions.
- printList() and find(x) take a linear-time;
- remove() take a constant time;
- insert() take a constant time.
- Push : insert an element into stack;
- Pop ? : delete the most recently inserted element.
- enqueue : inserts an element at the end of the list;
- dequeue : deletes the element at the start of the list.
總結
以上是生活随笔為你收集整理的List, Stack, and Queue的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: dbgrid的最小高度设置。否则出现滚动
- 下一篇: 苹果iOS 6悄然启用新型精准广告追踪技