首页 > 其他 > 详细

[ZZ]常用数据结构及复杂度

时间:2016-06-11 11:41:51      阅读:247      评论:0      收藏:0      [点我收藏+]

http://www.cnblogs.com/gaochundong/p/3813252.html

常用数据结构的时间复杂度

Data Structure

Add

Find

Delete

GetByIndex

 Array (T[])

O(n)

O(n)

O(n)

O(1)

 Linked list (LinkedList<T>)

O(1)

O(n)

O(n)

O(n)

 Resizable array list (List<T>)

O(1)

O(n)

O(n)

O(1)

 Stack (Stack<T>)

O(1)

-

O(1)

-

 Queue (Queue<T>)

O(1)

-

O(1)

-

 Hash table (Dictionary<K,T>)

O(1)

O(1)

O(1)

-

 Tree-based dictionary

 (SortedDictionary<K,T>)

  O(log n)  

  O(log n)  

  O(log n)  

-

 Hash table based set

 (HashSet<T>)

O(1)

O(1)

O(1)

-

 Tree based set

 (SortedSet<T>)

O(log n)

O(log n)

O(log n)

-

[ZZ]常用数据结构及复杂度

原文:http://www.cnblogs.com/pegasus923/p/5574833.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!