Which is better hashset or treeset?
Answer / Praveen Krishna Tiwari
Both HashSet and TreeSet are useful in different situations. HashSet provides faster access due to its use of a hash table, but lacks the ability to sort elements. TreeSet offers sorted elements with insertion order maintained, but it has slower performance compared to HashSet.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between hashmap and arraylist?
What is difference between an Array and ArrayList?
Define separate chaining?
What is sequential search? What is the average number of comparisons in a sequential search?
Discuss the difference between a stack and an Array?
Explain the terms base case, recursive case, binding time, run-time stack and tail recursion.
Define a queue?
What are the difference between malloc() and calloc()?
Name few classes that implement collection interface?
How to get top two numbers from an array?
Why do we use a multidimensional array in data structure?
What does the dummy header in the linked list contain?