Can we use ordered set for performing binary search?
Answer / Amarkumar
Yes, you can perform a binary search on an ordered Set or SortedSet in Java. Since the underlying data structure for these interfaces is usually TreeSet, which implements a Red-Black tree, it supports fast log(n) time complexity for binary search operations.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is entryset method in map?
what is AVL tree?
Define an algorithm. What are the types of algorithms?
How do you implement a stack?
Is it possible to insert different type of elements in a stack? How?
Why is hashmap faster than treemap?
What is ds tree?
Is array a collection?
Model a data structure for a DFA that takes an event as parameter and performs a desired action.
Questions related to arrays, such as given a 2 integer array, find the common elements.
What are binary trees?
What is list and its types?