Analyst Integration Question:
Download Questions PDF

Tell me how much time it take to retrieve an element if stored in HashMap, Binary tree and a Linked list? how it change if you have millions of records?

Integration Programmer Interview Question
Integration Programmer Interview Question

Answer:

In HashMap it takes O(1) time, in binary tree it takes O(logN) where N is number of nodes in tree and in linked list it takes O(n) time where n is number of element in list. Millions of records doesn't affect the performance if data structure are working as expected e.g. HashMap has no or relatively less number of collision or binary tree is balanced. If that's not the case then their performance degrades as number of records grows.

Download Integration Programmer Interview Questions And Answers PDF

Previous QuestionNext Question
Can you please explain the difference between Overriding and Overloading?Explain regular expression?