Comparision between BST, Array, LinkedList, Hashtable

本文对比了四种数据结构:BST、Hashtable、Array和LinkedList,阐述了它们各自的优势、缺点以及应用场景。BST支持快速按键顺序枚举、范围查询,但查找复杂度增加;Hashtable提供常数时间查找,不支持排序和范围查询;Array允许随机访问,修改困难;而LinkedList易于插入、扩展和调整大小,但不支持随机访问。

BST:

BST has the advantages of both array and linked list: it can do binary search and also it is of dynamic size.

BST allows fast enumeration of the items in key order.

  Lookup algorithms get more complicated when there may be multiple items with the same key.

support range query

 

Hashtable:

lookup operation in hashtable is constant.

cannot provide ordering

do not support range query 

 

Array:

allow random access

change is hard: need to change the whole structure

LinkedList:

allow easy insertion, extension, resize.

do not support random access

change is easy: just change the pointer

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值