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

HashMap VS BST

时间:2016-01-19 23:39:28      阅读:214      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!