Binary search MCQsBy: Prof. Dr. Fazal Rehman | Last updated: May 15, 2025 30 Score: 0 Attempted: 0/30 Subscribe 1. : What is the primary purpose of the Binary Search algorithm? (A) To find the maximum element in an array (B) To search for a specific element in a sorted array (C) To sort an array (D) To merge two arrays 2. : What is the time complexity of Binary Search in the worst case? (A) O(1) (B) O(n) (C) O(log n) (D) O(n log n) 3. : Which of the following conditions must be met for Binary Search to work? (A) The array must be unsorted (B) The array must be sorted (C) The array must contain unique elements (D) The array must be in ascending order only 4. : What is the best-case time complexity for Binary Search? (A) O(1) (B) O(n) (C) O(log n) (D) O(n log n) 5. : Which algorithm would typically be slower than Binary Search for large datasets? (A) Linear Search (B) Quick Sort (C) Merge Sort (D) Heap Sort 6. : How does Binary Search determine the next step in the search process? (A) By dividing the array into halves (B) By sorting the array (C) By searching in a linear manner (D) By checking every element 7. : In Binary Search, what happens if the middle element is less than the target? (A) Search continues in the left half (B) Search continues in the right half (C) Search ends (D) An error is thrown 8. : What is the space complexity of Binary Search when implemented iteratively? (A) O(1) (B) O(n) (C) O(log n) (D) O(n log n) 9. : What is the main advantage of Binary Search over Linear Search? (A) It requires less memory. (B) It works on unsorted arrays. (C) It is faster for large datasets. (D) It is easier to implement. 10. : How many comparisons can Binary Search make in the worst case for an array of size n? (A) n (B) log n (C) n/2 (D) n^2 11. : Which of the following is a disadvantage of Binary Search? (A) Requires a sorted array (B) More complex than Linear Search (C) Both A and B (D) None of the above 12. : What is the result of a Binary Search if the target element is found? (A) The index of the element (B) The value of the element (C) An error message (D) The middle index of the array 13. : How is the middle index calculated in Binary Search? (A) (low + high) / 2 (B) (low + high) (C) (high – low) / 2 (D) (low + high + 1) / 2 14. : What will Binary Search return if the target element is not found? (A) 0 (B) -1 (C) The index of the last element (D) An error message 15. : In which scenario is Binary Search most effective? (A) When the data is unsorted (B) When the dataset is small (C) When searching in large, sorted datasets (D) When looking for multiple occurrences 16. : What happens if the array is empty when performing Binary Search? (A) It returns the first index. (B) It returns -1. (C) It throws an exception. (D) It searches indefinitely. 17. : What type of search does Binary Search use? (A) Iterative (B) Recursive (C) Both iterative and recursive (D) None of the above 18. : How does Binary Search perform when dealing with duplicates? (A) It finds the first occurrence only. (B) It finds all occurrences. (C) It cannot handle duplicates. (D) It finds the last occurrence only. 19. : What is the typical use case for Binary Search? (A) Searching for an element in a large unsorted list (B) Searching for an element in a sorted array (C) Sorting a list (D) Merging two sorted lists 20. : Which of the following is true about Binary Search? (A) It can only be implemented recursively. (B) It can be implemented with a linked list. (C) It requires random access to the array elements. (D) It is always faster than Linear Search. 21. : What is the worst-case scenario for Binary Search? (A) The target is the first element. (B) The target is the last element. (C) The target is not in the array. (D) The target is in the middle. 22. : Which condition indicates that the search space has been exhausted in Binary Search? 23. : What is a practical application of Binary Search? (A) Searching in a phone book (B) Finding a book in a library (C) Checking availability in an inventory (D) All of the above 24. : What modification can be made to Binary Search to find the first occurrence of a target? (A) Change the middle calculation. (B) Continue searching in the left half even after finding the target. (C) Ignore duplicates. (D) Start from the end of the array. 25. : Which of the following is not a prerequisite for Binary Search? (A) The data must be sorted. (B) The data must be in an array. (C) The data must support random access. (D) The data can be of any type. 26. : What can be concluded about the efficiency of Binary Search compared to Linear Search? (A) Binary Search is always more efficient. (B) Binary Search is more efficient for larger datasets. (C) Both have the same efficiency. (D) Linear Search is more efficient for sorted data. 27. : How does the performance of Binary Search degrade? (A) With smaller datasets (B) With sorted arrays (C) With larger datasets (D) With unsorted arrays 28. : What must be true about the elements in the array for Binary Search to function correctly? (A) They must be unique. (B) They must be in ascending order. (C) They can be in any order. (D) They must be in descending order. 29. : What is the primary disadvantage of Binary Search? (A) It requires a sorted array. (B) It is slower than Linear Search. (C) It consumes more memory. (D) It can only find unique elements. 30. : Which of the following statements about Binary Search is false? (A) It can be implemented recursively. (B) It can be used on linked lists. (C) It has a logarithmic time complexity. (D) It works only on sorted arrays. Data Structures MCQs Basic Concepts Introduction to Data Structures Abstract Data Types (ADT) MCQs Complexity Analysis MCQs Time complexity MCQs Space complexity MCQs Big O, Big Ω, Big Θ notations MCQs Linear Data Structures MCQs Arrays MCQs One-dimensional arrays MCQs Multi-dimensional arrays MCQs Operations: traversal, insertion, deletion MCQs Linked Lists MCQs Singly linked list MCQs Doubly linked list MCQs Circular linked list MCQs Stacks MCQs Stack operations (push, pop, peek) MCQs Applications of stacks (expression evaluation, recursion) MCQs Queues MCQs Queue operations (enqueue, dequeue, front, rear) MCQs Types: Simple queue, circular queue, priority queue, deque MCQs Non-Linear Data Structures MCQs Trees MCQs Binary trees MCQs Binary Search Trees (BST) MCQs AVL Trees MCQs B-trees and B+ trees MCQs Tree traversal methods (in-order, pre-order, post-order) MCQs Heaps MCQs Min-heap MCQs Max-heap MCQs Heap operations (insertion, deletion, heapify) MCQs Applications of heaps (priority queues, heap sort) MCQs Graphs MCQs Graph representation (adjacency matrix, adjacency list) MCQs Graph traversal algorithms (DFS, BFS) MCQs Shortest path algorithms (Dijkstra’s, Bellman-Ford) MCQs Minimum Spanning Tree (Kruskal’s, Prim’s) MCQs Hashing MCQs MCQs Hash Tables Hash functions MCQs Collision resolution techniques (chaining, open addressing) MCQs Applications of hashing MCQs Sorting and Searching Algorithms MCQs Sorting Algorithms MCQs Bubble sort MCQs Selection sort MCQs Insertion sort MCQs Merge sort MCQs Quick sort MCQs Heap sort MCQs Searching Algorithms MCQs Linear search MCQs Binary search MCQs Interpolation search MCQs Miscellaneous Memory Management in data structures MCQs Dynamic memory allocation MCQs Garbage collection MCQs String Manipulation Algorithms MCQs Pattern matching (KMP, Rabin-Karp) MCQs String hashing MCQs Data Structures MCQs 1 Data Structures MCQs 2 Data Structures MCQs 3 Data Structures MCQs 4 Data Structures MCQs 5 Stacks Solved MCQs Queues MCQs pointer mcqs Array MCQs Related Posts:Top 10 Search Engine for SEO Search engine optimizationDesired numbers of search results in one search pageBinary Search Trees (BST) MCQsProgram to Implement Binary Search in CPP (C plus plus)Search Engine Optimization (SEO) MCQsSEO tools (e.g., Google Search Console, Ahrefs) MCQs