using array, we can do in O(logn) always as it is ordered. If all values
hash to same bucket in case of hashtable, it would be O(n) worse case

On Thu, Jul 28, 2011 at 12:03 AM, rajeev bharshetty <[email protected]>wrote:

> Hash Table with Bucket , made of linked list .
>
> At most if all n values hash to same bucket then at worst case we must
> traverse n linked list nodes to find the element.
>
> Hope it is clear
>
>
> On Wed, Jul 27, 2011 at 11:59 PM, Reynald <[email protected]> wrote:
>
>> Which of the following data structure do better job (has lesser time
>> complexity) at searching elements that has a worst-case time
>> complexity of O(n)? Do not account for the cost of building the Data
>> structure in searching cost.
>> a) Linked list with element sorted by value
>> b) Binary tree with no ordering
>> c) Ordered array
>> d) Hast table with bucket, made up of linked list, where linked list
>> have no ordering.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Regards
> Rajeev N B <http://www.opensourcemania.co.cc>
>
> "*Winners Don't do Different things , they do things Differently"*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to