首页 > 其他 > 详细

HashMap VS BST

时间:2016-01-19 23:37:11      阅读:228      评论:0      收藏:0      [点我收藏+]

HashMap usually performs search operations bounded with complexity of O(1)<=T(n)<=O(n). BST performs search operations in O(logN)<=T(n)<=O(N). 

HashMap is implemented with array and hash function. HashMap has O(1) lookup time when the hashcode disperse keys appropriately. 

For some special cases, lookup time can be much longer if the number of elements stored is sufficiently large. 

 

HashMap VS BST

原文:http://www.cnblogs.com/touchdown/p/5143655.html

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