« 上一篇: N2.TCP/IP协议 下一篇: Blue »
小飞 @ 2010-09-14 10:13

Java 数据类型


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



S low 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.



C omplex.



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



任何数据的算法,最基础的方法

1.Insert
2.Search
3.Delete
4.iterate






评论 / 个人网页 / 扔小纸条
*昵称

已经注册过? 请登录

Email
网址
*评论