Search
Question: In which scenario is binary search NOT applicable?Options: Finding an element in a sorted ..
Question: Which of the following is a prerequisite for using binary search?Options: The array must b..
Question: Which of the following modifications can be made to binary search to find the first occurr..
Question: What is the result of performing binary search on an array with duplicate values?Options: ..
Question: In a binary search tree (BST), how does binary search differ from searching in a sorted ar..
Question: What happens if binary search is applied to a linked list?Options: It works efficientlyIt ..
Question: If a binary search is performed on a sorted array of size n, what is the space complexity?..
Question: Which of the following is a key advantage of binary search over linear search?Options: Sim..
Question: What is the maximum number of comparisons needed to find an element in an array of size 10..
Question: In binary search, if the target value is not found, what will be the return value?Options:..
Question: In binary search, if the target is less than the middle element, what should be the next s..
Question: What is the average time complexity of binary search?Options: O(n)O(log n)O(n log n)O(1)Co..
Question: Which of the following is a prerequisite for applying binary search?Options: The array mus..
Question: What is the worst-case scenario for the number of comparisons made by binary search?Option..
Question: In a binary search algorithm, what happens if the middle element is equal to the target?Op..
Question: What is the main advantage of using binary search over linear search?Options: Binary searc..
Question: If the target value is not present in the array, what will binary search return?Options: T..
Question: Which of the following conditions must be true for binary search to work?Options: Array mu..
Question: What is a common use of BFS in networking?Options: Finding the maximum flow in a network.B..
Question: In a tree structure, which traversal method is typically used for searching?Options: BFSDF..
Question: Which of the following is a real-world application of DFS?Options: Finding the shortest pa..
Question: Which of the following statements about BFS and DFS is false?Options: BFS can find the sho..
Question: Which algorithm is best suited for finding connected components in a graph?Options: BFSDFS..
Question: Which of the following is a disadvantage of DFS?Options: It can get stuck in deep paths.It..
Question: What is the primary data structure used in DFS?Options: ArrayStackQueueLinked ListCorrect ..
Question: In a graph, which traversal method uses a queue data structure?Options: DFSBFSBoth DFS and..
Question: Which algorithm would you use to find the shortest path in a weighted graph?Options: BFSDF..
Question: In a graph with V vertices and E edges, what is the time complexity of DFS?Options: O(V)O(..
Question: Which of the following is NOT a characteristic of BFS?Options: Uses a queueFinds the short..
Question: What is the primary difference between BFS and DFS in terms of traversal strategy?Options:..