Which data structure is typically used for binary search?
- Array
- Linked List
- Sorted Array
- Stack
Binary search is typically performed on a sorted array. The reason for this is that binary search requires the elements to be in sorted order to efficiently divide and conquer the search space, reducing the time complexity to O(log n) compared to O(n) for linear search in an unsorted array.
Loading...
Related Quiz
- What are Git hooks, and how can they be used in a development workflow?
- You're developing a web application that handles sensitive user data. How would you design a secure authentication system to protect user accounts from unauthorized access?
- Which ACID property ensures that transactions maintain consistency in the database?
- In Multilevel Queue Scheduling, processes are assigned to _________ based on their characteristics.
- What is the role of indexing in improving the performance of database queries?