0% found this document useful (0 votes)
2 views

Mcqs on Data Structures and Algorithms

The document contains links to multiple-choice questions (MCQs) on data structures and algorithms, along with a series of quiz questions from a semester. It covers various concepts including search algorithms, sorting algorithms, time complexities, and Java programming specifics. Additionally, it provides specific quiz questions with multiple-choice answers related to these topics.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Mcqs on Data Structures and Algorithms

The document contains links to multiple-choice questions (MCQs) on data structures and algorithms, along with a series of quiz questions from a semester. It covers various concepts including search algorithms, sorting algorithms, time complexities, and Java programming specifics. Additionally, it provides specific quiz questions with multiple-choice answers related to these topics.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Kindly Subscribe to my YouTube Page:

https://www.youtube.com/channel/UCY03nWShoNCDd29uHCbqyJw

MCQS ON DATA STRUCTURES AND ALGORITHMS:


1.https://www.tutorialspoint.com/data_structures_algorithms/data_structures_algorithms_online_quiz.
htm

2.https://examradar.com/mcqs/data-structure-mcqs/

3.https://engineeringinterviewquestions.com/data-structures-and-algorithms-multiple-choice-
questions-and-answers/

4.https://www.studocu.com/row/document/adama-science-and-technology-university/java-
programming/data-structures-and-algorithms-mcq-questions/20796651

SOME QUIZ QUESTIONS FROM THIS SEMESTER:

1. Given the array 12 45 67 56 20 and a key of 45, how many comparisons will be made in
binary search?
A. 1
B. 3
C. 2
D. 4
2. What is the output of the following code? String name = "John";
System.out.println(name.length());
A. 3
B. 4
C. 5
D. Error
3. What is the first number in the Fibonacci sequence?
A. 0
B. 1
C. 2
D. -1
4. What is the default value assigned to an uninitialized variable of type int in Java?
A. 0
B. 1
C. -1
D. null
5. What is the time complexity of the quicksort algorithm in the average case?
A. O (1)
B. O (log n)
C. O (n)
D. O (n log n)
6. Which special pointer indicates the absence of a node’s successor?
A. null
B. void
C. dangling
D. wild
7. Which keyword is used to create an object in Java?
A. class
B. new
C. object
D. create
8. A mixture of natural language and programming language like – construct is called ___
A. code proper
B. pseudocode
C. program
D. domain-specific language
9. The time complexity of a divide and conquer algorithm can be expressed using the
following:
A. Big O notation
B. Theta notation
C. Omega notation
D. All of the above
10. A graph with numbers assigned to its edges is called __
A. weighted graph
B. directed graph.
C. path graph
D. numbered graph
11. What is the access modifier for a public member variable in a class?
A. public
B. private
C. protected
D. default
12. Which traversal order does the depth-first search follow?
The depth-first search (DFS) algorithm follows the order known as the depth-first traversal
order.
13. Algorithms that require an exponential number of operations are practical for solving
only problems of tiny size.
A. true
B. false
14. What is the output of the following code? int x = 5; System.out.println(x++);
A. 4
B. 5
C. 6
D. Error
15. Given that C(n) = 0.5n(n-1), how much longer will an algorithm run if we triple the input
size?
A. 9
B. 12
C. 6
D. 4
16. Big O is associated with ___
A. best case and upper bound
B. average case and upper bound
C. worst case and upper bound
D. lower bound and worst case
17. Which searching algorithm is commonly used to find the shortest path in a graph?
A. Linear search
B. Binary search
C. Breadth-first search
D. Depth-first search
18. Which algorithm is most suitable for searching an element in an array with non-
uniformly distributed values?
A. Linear search
B. Binary search
C. Interpolation search
D. Hashing
19. Which searching algorithm has the time complexity of O(log n)?
A. Linear search
B. Binary search
C. Quick sort
D. Bubble sort
20. Which sorting algorithm is known for its stability, i.e., it maintains the relative order of
elements with equal values?
A. Bubble sort
B. Insertion sort
C. Merge sort
D. Quick sort
21. Which sorting algorithm is known for its in-place sorting, i.e., it does not require
additional space for sorting?
A. Merge sort
B. Quick sort
C. Insertion sort
D. Radix sort
22. Which sorting algorithm is efficient for sorting extensive data collections with fixed-
length keys?
A. Bubble sort
B. Insertion sort
C. Heap sort
D. Radix sort
23. Which searching algorithm is efficient for finding an array's maximum or minimum
element?
A. Linear search
B. Binary search
C. Interpolation search
D. Hashing
24. Which search algorithm is commonly used to search in a binary search tree?
A. Linear search
B. Binary search
C. Interpolation search
D. Depth-first search
25. Which searching algorithm is most suitable for searching an element in an extensive
collection of data stored on Disk or secondary memory?
A. Linear search
B. Binary search
C. Interpolation search
D. External search
26. Which sorting algorithm is commonly used as a subroutine in other sorting algorithms,
such as quicksort?
A. Bubble sort
B. Merge sort
C. Insertion sort
27. Which searching algorithm is efficient for large data collections stored in a hash table?
A. Linear search
B. Binary search
C. Interpolation search
D. Hashing
28. Which sorting algorithm is known for its average-case time complexity of O(n log n)?
A. Bubble sort
B. Insertion sort
C. Merge sort
D. Radix sort
29. Which sorting algorithm uses a divide-and-conquer strategy?
A. Bubble sort
B. Insertion sort
C. Quick sort
D. Shell sort
30. Given a list of 10,000 elements, and if each comparison takes 2 µs, what is the longest
possible runtime for linear search?
A. 120 µs
B. 200 µs
C. 20000 µs
D. 201 µs
31. The list is sorted into ascending order: (chopsticks, forks, knives, spork)
A. True
B. False
32. The list is sorted into ascending order: (3, 9, 44, 18, 76)
A. True
B. False
33. Given list: (4, 11, 17, 18, 25, 45, 63, 77, 89, 114). How many list elements will be
checked to find the value 17 using binary search?
A. 5
B. 8
C. 9
D. 3
34. A sort that relatively passes through a list to exchange the first element with any element
less than it and then repeats with a new first element is called______
A. quick sort
B. heap sort
C. insertion sort
D. bubble sort
35. What is the worst-case complexity of the breadth-first search algorithm? Assume n is the
number of nodes in the graph and m is the number of edges.
A. O(nm)
B. O(log n+m)
C. O(m log n)
D. O(n+m)
E. O(log n)
36. Run Time of Merge Sort is______
A. Theta of N log N
B. Gamma of N log N
C. Big O of N log N Incorrect
D. Omega of N log N
37. The list is sorted into ascending order: (great, greater, greatest)
A. True
B. False
38. Suppose a sorted list of 1024 elements is searched with binary search. How many distinct
list elements are compared against a search key that is less than all elements in the list?
A. 102 elements
B. 502 elements
C. 8 elements
D. 10 elements
39. Given a list of 10,000 elements, and if each comparison takes 2 µs, what is the fastest
possible runtime for linear search?
A. 8 µs
B. 2 µs
C. 5 µs
D. 6 µs
40. Assume selection sort's goal is to sort in ascending order. Given list (5, 9, 8, 7, 6) and i =
1, what will be the list after completing the second outer loop iteration?
Therefore, the correct answer is (5, 6, 8, 7, 9)

41. Suppose a list of 1024 elements is searched with a linear search. How many distinct list
elements are compared against a search key that is less than all elements in the list?
Therefore, the correct answer is 1024 elements.

42. Assume selection sort's goal is to sort in ascending order. Given list (9, 8, 7, 6, 5), how
many swaps will occur during the first pass of the outer loop (i = 0)?
Therefore, the correct answer is 4 swaps.

43. Which of the following is not a primitive data type in Java?


A. int
B. boolean
C. string
D. double
44. Which of the following is NOT a step in the divide and conquer technique?
A. Divide
B. Combine
C. Analyze
D. Sort
45. Which algorithm uses divide and conquer to multiply two polynomials efficiently?
A. QuickSort
B. MergeSort
C. Binary Search
D. Karatsuba algorithm
46. In the tower of Hanoi problem, two or more discs can be moved at a time.
A. true
B. false
47. Which of the following best describes a growth function?
A. An algorithm that solves a problem using a divide-and-conquer approach.
B. A mathematical function that describes the resource usage of an algorithm as the
input size increases.
C. A technique for optimizing data structures to minimize memory consumption.
D. A measure of the complexity of an algorithm based on the number of operations it
performs.
48. Algorithms that require an exponential number of operations are practical for solving
only problems of tiny size.
A. true
B. false
49. Which special pointer indicates the absence of a node’s successor?
A. null
B. void
C. dangling
D. wild
50. Which notation is commonly used to represent the worst-case time complexity of an
algorithm?
A. O (1)
B. O (log n)
C. O (n)
D. O (n^2)
51. Given the array 12 43 67 56 20 and a key of 43, how many comparisons will be done in
binary search?
A. 1
B. 3
C. 2
D. 4
52. Which algorithm uses divide and conquer to solve the maximum subarray sum problem
efficiently in O(n) time?
A. QuickSort
B. MergeSort
C. Binary Search
D. Kadane's algorithm
53. Which keyword is used to define a constant variable in Java?
A. final
B. static
C. const
D. constant
54. What is the main advantage of using the divide and conquer technique?
A. It guarantees a linear time complexity for all problems.
B. It reduces the space complexity of algorithms.
C. It allows for efficient parallelization of algorithms.
D. It eliminates the need for recursion in algorithms.
55. Determine if each of the following lists is unsorted, sorted, or nearly sorted. Assume
ascending order. (23, 24, 36, 48, 19, 50, 101)
A. Unsorted
B. Sorted
C. Nearly sorted.
56. How many times longer will sorting a list of 500 elements take compared to a list of 50
elements?
A. 100
B. 400
C. 50
D. 500
57. The growth function O (n log n) represents which type of time complexity?
A. Linear
B. Logarithmic
C. Quadratic
D. Superlinear
58. Determine if each of the following lists is unsorted, sorted, or nearly sorted. Assume
ascending order. (15, 19, 21, 24, 2, 3, 6, 11)
A. Unsorted
B. Sorted
C. Nearly sorted.
59. Given list: (4, 11, 17, 18, 25, 45, 63, 77, 89, 114 ). How many list elements will be
checked to find the value 17 using binary search?
A. 8
B. 5
C. 9
D. 3
60. How many comparisons are performed by linearSearch() for each example? Array: (12,
75, 18, 22, 94, 16, 22) Key: 94
A. 3
B. 5
C. 8
D. 9
61. Given list: (20, 4, 114, 23, 34, 25, 45, 66, 77, 89, 11). How many list elements will be
compared to find 77 using linear search?
A. 8
B. 9
C. 5
D. 6
62. _________________deal with geometric objects such as points, lines, and polygons.
A. Algorithm
B. science
C. Programming
D. Geometric algorithm

63. There are few data structures that have proved to be particularly important for
________________
A. network algorithm
B. algorithm
C. computer algorithm
D. data algorithm
64. Which of the following statements is true about brute force algorithms?
A. They are always the most efficient solution.
B. They always require exponential time to execute.
C. They are only applicable to problems with small input sizes.
D. They are helpful when no efficient algorithm exists for a problem.
65. The list is sorted into descending order: (F, D, C, B, A)
A. True
B. False
66. Suppose the selectionSort() method is executed with the array (3, 12, 7, 2, 9, 14, 8). What
is the final value for the variable i inside the inner loop?
A. 5
B. 7
C. 6
67. When sorting a list with 50 elements, indexSmallest will be assigned to a minimum of
_____ times.
A. 19
B. 50
C. 0
D. 49
68. Suppose a list of 1024 elements is searched with a linear search. How many distinct list
elements are compared against a search key that is less than all elements in the list?
A. 402 elements
B. 1024 elements
C. 502 elements
D. 1000 elements
69. The list is sorted into descending order: (20, 15, 10, 5, 0)
A. True
B. False
70. A sort that relatively passes through a list to exchange the first element with any element
less than it and then repeats with a new first element is called______________
A. heap sort
B. bubble sort
C. insertion sort
D. quick sort
71. Which searching algorithm uses a priority queue to explore nodes and is commonly used
for pathfinding in computer games?
A. Linear search
B. Binary search
C. Breadth-first search
D. Depth-first search
72. Which sorting algorithm is based on repeatedly dividing the array into two halves and
then merging them in a sorted manner?
A. Bubble sort
B. Merge sort
C. Selection sort
D. Quick sort
73. Which sorting algorithm is suitable for sorting a linked list?
A. Bubble sort
B. Merge sort
C. Selection sort
D. Quick sort
74. Which sorting algorithm has a best-case time complexity of O(n) and a worst-case time
complexity of O(n^2)?
A. Merge sort
B. Quick sort
C. Insertion sort
D. Radix sort
75. Which sorting algorithm has a worst-case time complexity of O(n log n) and space
complexity of O(n)?
A. Selection sort
B. Insertion sort
C. Heap sort
D. Radix sort
76. Which sorting algorithm works by repeatedly selecting the smallest element from the
unsorted portion and placing it at the beginning of the sorted amount?
A. Bubble sort
B. Insertion sort
C. Selection sort
D. Quick sort
77. In modern terms, Euclid’s algorithm is based on applying__________
A. repeatedly the equity
B. repeatedly the equality
C. repeatedly the equilibrium
D. repeatedly the equal
78. ______________ is a straightforward approach to solving a problem, usually directly
based on the problem statement and definitions of the concepts involved.
A. linear
B. Force
C. Brute force
D. Algorithm
79. Steps for Divide and Conquer approach, select all that apply:
A. Combine, Divide and Conquer
B. Divide, Conquer and Combine
C. Combine, Conquer and Divide
D. Divide, Combine and Conquer
80. The decrease-and-conquer technique is based on exploiting the relationship between a
solution to a given instance of a problem and a solution to its smaller instance.
A. True
B. False
81. The searching problem deal with finding a given value called a/an_______________
A. search key
B. output key
C. input key
D. house key
82. A rooted tree is usually depicted by placing its root on the top.
A. True
B. False
83. The adjacency list of a graph or a digraph is a collection of linked lists, one for each
vertex, that contain all the vertices adjacent to the list’s vertex.
A. True
B. False
84. Which of the following represents the time complexity of LCS?
A. O(mn!)
B. O(n!)
C. O(m!)
D. O(mn)
85. In an organization, algorithms from different areas of computing are grouped together if
they have the same_____________.
A. science approach
B. design approach
C. solution approach
D. algorithm approach
86. Warshall’s algorithm for finding the transitive closure and Floyd’s algorithm for the all-
pairs shortest-paths problem is not based on the idea that can be interpreted as an
application of the dynamic programming technique.
A. False
B. True
87. The term “exhaustive search” can also be applied to two very important algorithms that
systematically process all vertices and edges of a graph.
A. True
B. False
88. As a practical matter, the validity of programs is still established by__________
A. analyzing
B. testing
C. Solving
D. Implementing
89. It is not difficult to identify the basic operation of an algorithm.
A. True
B. False
90. One classifies algorithms according to a _____________
A. Solution type
B. Software type
C. Application type
D. Problem type.
91. Dynamic programming is an algorithm design technique with a rather interesting history.
A. False
B. True
92. Programming an algorithm presents both peril and opportunity.
A. True
B. False
93. A/an__________ is a sequence of vertices in which every consecutive pair of the vertices
is connected by an edge directed from the vertex listed first to the vertex listed next.
A. discontinuous path
B. undirected path
C. continuous path
D. directed path.
94. Most algorithms are destinated to be ultimately implemented
as_________________________
A. computer programs
B. Computer software
C. computer peripheral.
D. Computer hardware
95. It is often convenient to start a link with a special node called______________
A. Sort
B. Algorithm
C. Loop
D. header
96. ____________ is a technique for solving problems with overlapping Subproblems.
A. Dynamic programming
B. Movable programming
C. Static programming
D. Java programming
97. The array and linked list are two principal choices in representing a more abstract data
structure called a linear list or simply a list.
A. True
B. False
98. Data structures and algorithms should be chosen to strike a balance among the
requirements of each _________________
A. operation
B. Application
C. document
D. work
99. An algorithm is a sequence of unambiguous instructions for solving a_____________
problem.
A. problem
B. data
C. information
D. solution
100. A data structure can be defined as a particular scheme of organizing
related______________
A. Items
B. Software items
C. Data items
D. Hardware items
101. _____________is a divide-and-conquer sorting algorithm.
A. Merge sort
B. Queue
C. Star sort.
D. Sort algorithm
102.A stack is a list in which insertions and deletions can be done only at the end. 3rationale
A. True
B. False
103. Which term best describes the time complexity of an exhaustive search algorithm?
A. Constant
B. Quadratic
C. Linear
D. Exponential
104. Which problem-solving technique is commonly associated with exhaustive search?
A. Divide and conquer.
B. Greedy algorithms
C. Dynamic programming
D. Backtracking
105. Which of the following best describes an exhaustive search?
A. A search algorithm that explores all possible solutions
B. A technique that reduces the problem space by eliminating unnecessary options
C. An approach that uses heuristics to find the optimal solution.
D. A method that prioritizes efficiency over completeness
106. Which statement is true about the efficiency of brute force algorithms?
A. They are always more efficient than other algorithms.
B. They are only efficient for small-scale problems.
C. They have the same efficiency as other algorithms in most cases.
D. They are generally less efficient than other algorithms.
107. Which data structure is commonly used in exhaustive search
algorithms?
A. Stacks
B. Queues
C. Priority queues
D. Recursion
108. Which type of problems are most suitable for an exhaustive search approach?
A. Problems with known suboptimal solutions
B. Problems with overlapping subproblems
C. Problems with a high degree of randomness
D. Problems with limited solution spaces

109. What is the primary advantage of using exhaustive search over other algorithms?
A. It always finds the optimal solution.
B. It requires fewer computational resources.
C. It guarantees faster execution time.
D. It is more straightforward to implement.
110. Which technique can be used to optimize a brute force algorithm?
A. Memorization
B. Divide and conquer.
C. Backtracking
D. Heuristic search
111. Which term best describes the approach used by brute force
algorithms?
A. Optimistic
B. Pessimistic
C. Pragmatic
D. Opportunistic
112. When is brute force a suitable approach?
A. When the problem size is too large to handle.
B. When the problem has a known optimal solution.
C. When the problem requires sophisticated heuristics.
113. What is the primary disadvantage of using brute force in algorithm design?
A. It requires extensive knowledge of advanced data structures.
B. It is inefficient and can be computationally expensive.
C. It is difficult to implement and prone to errors.
D. It is only applicable to small-scale problems.
114. What is the main advantage of using an exhaustive search?
A. It guarantees to find the optimal solution.
B. It requires minimal computational resources.
C. It is faster than other search algorithms.
D. It applies only to small-sized problems.
115. What is the time complexity of a brute force algorithm?
A. O(n log n)
B. O(n^2)
C. O(log n)
D. O(1)

116. Which of the following statements is true about exhaustive search algorithms?
A. They are always the most efficient solution,
B. They are primarily used for problem-solving in artificial intelligence.
C. They explore all possible solutions and find the global optimum.
D. They are most suitable for problems with large search spaces.

117. Which of the following is NOT a characteristic of brute force algorithms?


A. They explore all possible solutions.
B. They are based on exhaustive searches.
C. They often involve trying every possible option.
D. They are always the most efficient approach.

118. What does the "merge" step involve in the merge sort algorithm?
A. Sorting the individual elements of the array.
B. Dividing the array into smaller subarrays.
C. Combining two sorted subarrays into a single sorted array.
D. Repeatedly partitioning the array into smaller sections.
119. Which of the following statements is true about brute force algorithms?
A. They are always the most efficient solution.
B. They always require exponential time to execute.
C. They are only applicable to problems with small input sizes.
D. They are helpful when no efficient algorithm exists for a problem.

120. Which problem-solving approach is considered more efficient than brute force for large-
scale problems?
A. Greedy algorithms
B. Dynamic programming
C. Divide and conquer.
D. Backtracking

121. Which of the following is an example of a brute force algorithm?


A. Binary search
B. Dijkstra's algorithm
C. Bubble sort
D. Quick sort

122. What is the primary drawback of using an exhaustive search for large-scale problems?
A. It requires specialized hardware to execute efficiently.
B. It often leads to a stack overflow error.
C. It may take an impractical amount of time to complete.
D. It requires a significant amount of memory to store intermediate results.

123. What is the primary disadvantage of exhaustive search algorithms?


A. They are inefficient for large input sizes.
B. They are challenging to implement correctly.
C. They can only be applied to simple problems.
D. They require specialized data structures.

124. What is the primary drawback of using an exhaustive search for large-scale problems?
A. It requires specialized hardware to execute efficiently.
B. It often leads to a stack overflow error.
C. It may take an impractical amount of time to complete.
D. It requires a significant amount of memory to store intermediate results.

125. What is brute force in the context of data structures?


A. A strategy that uses the most straightforward approach to solve a problem.
B. A technique that prioritizes efficiency and speed in algorithm design
C. A method that eliminates all possibilities to find the optimal solution.
D. A way to reduce the search space by applying heuristics.

126. Which term best describes the time complexity of an exhaustive


search algorithm?
A. Constant
B. Quadratic
C. Linear
D. Exponential

127. What is the main difference between brute force and greedy algorithms?
A. Greedy algorithms are more efficient than brute-force algorithms.
B. Brute force algorithms explore all possible solutions, while greedy algorithms make
locally optimal choices.
C. Greedy algorithms are only applicable to small-scale problems.

128. Which data structure is commonly used in brute force algorithms?


A. Linked lists.
B. Trees
C. Hash tables
D. Arrays

129. Which of the following is NOT a characteristic of brute force algorithms?


A. They explore all possible solutions.
B. They are based on exhaustive searches.
C. They often involve trying every possible option.
D. They are always the most efficient approach.

130. Which of the following is an example of a problem where brute force is the only viable
approach?
A. Sorting an extensive array of integers.
B. Finding the shortest path in a graph.
C. Testing all possible combinations of a password.
D. Finding the maximum value in a binary search tree.

131. What is the main drawback of using brute force for problem-solving?
A. It lacks generality and cannot be applied to various problem domains.
B. It requires advanced knowledge of mathematical formulas.
C. Itis highly susceptible to errors and mistakes in implementation
D. It often leads to exponential time complexity.

132. How does an exhaustive search differ from a greedy algorithm?


A. Exhaustive search explores all possible solutions, while greedy algorithms make locally
optimal choices.
B. Exhaustive search requires fewer computational resources than greedy algorithms.
C. Greedy algorithms guarantee to find the optimal solution, while exhaustive search does not.
D. Greedy algorithms only apply to small-scale problems, while exhaustive searches can handle
more significant issues.

133. Which term best describes the computational complexity of a brute


force algorithm?
A. Polynomial
B. Exponential
C. Logarithmic
D. Linear

134.How many times longer will sorting a list of 20 elements take compared to sorting a list of
10 elements?
A. 1
B. 4
C. 20
D. 10

135.When sorting a list with 50 elements, indexSmallest will be assigned to a minimum of _____
times.
A. 19
B. 50
C. 49
D. 0

136. A sort that relatively passes through a list to exchange the first element with any element
less than it and then repeats with a new first element is called______________
A. quick sort
B. insertion sort
C. bubble sort
D. heap sort
137.How many times longer will sorting a list of 500 elements take compared to a list of 50
elements?
A. 500
B. 50
C. 400
D. 100

138.Which sorting algorithm works by repeatedly selecting the smallest element from the
unsorted portion and placing it at the beginning of the sorted amount?
A. Bubble sort
B. Insertion sort
C. Selection sort
D. Quick sort

139.Which searching algorithm has a time complexity of O(n)?


A. Linear search
B. Binary search
C. Interpolation search
D. Hashing

140. What does the "conquer" step involve in the divide and conquer technique?
A. Breaking down the problem into smaller subproblems.
B. Combining the solutions of the subproblems to obtain the final solution.
C. Iteratively reducing the problem size until it can be solved directly.
D. Analyzing the algorithm's complexity to determine the time and space requirements.
141. Which sorting algorithm works by repeatedly swapping adjacent elements if they are in the
wrong order?
A. Bubble sort
B. Quick sort
C. Heap sort
D. Shell sort

142. Which of the following sorting algorithms has the worst-case time complexity of O(n^2)?
A. Merge sort
B. Insertion sort
C. Selection sort
D. Quick sort

143.Which sorting algorithm is suitable for sorting data that is already partially sorted or
contains many equal elements?
A. Bubble sort
B. Merge sort
C. Insertion sort
D. Quick sort

144.Which searching algorithm efficiently finds an element in a balanced binary search tree?
A. Linear search
B. Binary search
C. Interpolation search
D. Hashing

145.Which searching algorithm requires the elements to be in sorted order?


A. Linear search
B. Binary search
C. Interpolation search
D. Hashing

146.Which of the following is not a searching technique?


A. Linear search
B. Binary search
C. Bubble sort
D. Hashing

147. Which sorting algorithm has a best-case time complexity of O(n) and a worst-case time
complexity of O(n^2)?
A. Merge sort
B. Quick sort
C. Insertion sort
D. Radix sort

148.Which of the following is NOT a typical application of the divide and conquer technique?
A. Sorting algorithms
B. Searching algorithms.
C. Graph traversal algorithms
D. Matrix multiplication algorithms

149. What is the time complexity of the binary search algorithm?


A. O (1)
B. O (log n)
C. O (n)
D. O (n log n)

150.Which of the following is NOT a step in the divide and conquer technique?
A. Combine
B. Analyze
C. Divide
D. Search

You might also like