码迷,mamicode.com
首页 > 其他好文 > 详细

Overview of Data Structures

时间:2014-09-29 13:26:30      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:des   io   ar   strong   for   sp   div   art   on   

 

Data Structure
 
 
 
Advantages
 
 
 
 
Disadvantages
 
 
 
 
 
 
 
 
Array
 
 
 
Quick insertion, very fast access if index known
 
 
 
 
Slow search, slow deletion, fixed size.
 
 
 
 
Ordered array
 
 
 
Quicker search than unsorted array.
 
 
 
 
Slow insertion and deletion, fixed size.
 
 
 
 
Stack
 
 
 
Provides last-in, first-out access.
 
 
 
 
Slow access to other items.
 
 
 
 
Queue
 
 
 
Provides first-in, first-out access.
 
 
 
 
Slow access to other items.
 
 
 
 
Linked list
 
 
 
Quick insertion, quick deletion.
 
 
 
 
Slow search.
 
 
 
 
Binary tree
 
 
 
Quick search, insertion, deletion (if tree remains balanced).
 
 
 
 
Deletion algorithm is complex.
 
 
 
 
Red-black tree
 
 
 
Quick search, insertion, deletion. Tree always balanced.
 
 
 
 
Complex.
 
 
 
 
2-3-4 tree
 
 
 
Quick search, insertion, deletion. Tree always balanced. Similar trees good for disk storage.
 
 
 
 
Complex.
 
 
 
 
Hash table
 
 
 
Very fast access if key known. Fast insertion.
 
 
 
 
Slow deletion, access slow if key not known, inefficient memory usage.
 
 
 
 
Heap
 
 
 
Fast insertion, deletion,
 
 
 
 
Slow access to other items.access to largest item.
 
 

 
 
Graph
 
 
 
Models real-world situations.
 
 
 
 
Some algorithms are slow and complex.

Overview of Data Structures

标签:des   io   ar   strong   for   sp   div   art   on   

原文地址:http://www.cnblogs.com/banxian/p/3999744.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!