Which searching algorithm requires the elements to be in sorted order?
- Binary search
- Depth-first search
- Hashing
- Linear search
Binary search requires the elements to be in sorted order because it uses the principle of divide and conquer, comparing the middle element and eliminating half of the search space in each step.
Loading...
Related Quiz
- What is the time complexity of the bubble sort algorithm?
- A new office building is being set up, and you need to plan the network infrastructure for efficient routing and switching. What factors would you consider in designing the network layout?
- How does React Router differ from Angular Router in handling routing?
- Which type of testing focuses on finding defects by executing the software?
- Explain the Banker's algorithm for deadlock avoidance.