81. Given an input arr = {2, 5, 7, 99, 899}; key = 899; What is the level of recursion?
82. Exponential search performs better than binary search when the element being searched is present near the starting point of the array.
83. What is the best case runtime of linear search(recursive) algorithm on an ordered set of elements?
84. What does the following piece of code do?
for (int i = 0; i < arr.length-1; i++)
{
for (int j = i+1; j < arr.length; j++)
{
if( (arr[i].equals(arr[j])) && (i != j) )
{
System.out.println(arr[i]);
}
}
}
for (int i = 0; i < arr.length-1; i++)
{
for (int j = i+1; j < arr.length; j++)
{
if( (arr[i].equals(arr[j])) && (i != j) )
{
System.out.println(arr[i]);
}
}
}
85. In which of the cases uniform binary search fails compared to binary search?
86. What is the time complexity of uniform binary search?
87. What is the worst case complexity of binary search using recursion?
88. Which of the following searching algorithm is fastest when the input array is sorted and has uniformly distributed values?
89. Best case of the exponential search will have time complexity of?
90. Exponential search has . . . . . . . .
Read More Section(Searching Algorithms)
Each Section contains maximum 100 MCQs question on Searching Algorithms. To get more questions visit other sections.