What is the length of the step in jump search?
n
n/2
sqrt(n)
1
Browse topic-based Data Structure And Algorithm practice sets.
302 practice sets · Page 5 of 16
What is the length of the step in jump search?
n
n/2
sqrt(n)
1
Which of the following is not an advantage of Fibonacci Search?
When the element being searched for has a non uniform access storage
Can be used in magnetic tapes
Can be used for large arrays which do not fit in the CPU cache or in the RAM
It can be applied efficiently on unsorted arrays
What is the time complexity of Fibonacci Search?
O(logn)
O(n)
O(n^{2})
O(nlogn)
Choose the recursive formula for the Fibonacci series.(n>=1)
(F(n) = F(n+1) + F(n+2))
(F(n) = F(n) + F(n+1))
(F(n) = F(n-1) + F(n-2))
(F(n) = F(n-1) - F(n-2))
Which algorithmic technique does Fibonacci search use?
Brute force
Divide and Conquer
Greedy Technique
Backtracking
What is the time complexity of binary search with iteration?
O(nlogn)
O(logn)
O(n)
O(n^{2})
Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the mid values(corresponding array elements) generated in the first and second iterations?
90 and 99
90 and 100
89 and 94
94 and 99
Given an array arr = {5,6,77,88,99} and key = 88; How many iterations are done until the element is found?
1
3
4
2
Binary Search can be categorized into which of the following?
Brute Force technique
Divide and conquer
Greedy algorithm
Dynamic programming
Which of the following is not an application of binary search?
To find the lower/upper bound in an ordered sequence
Union of intervals
Debugging
To search in unordered list
What is the average case time complexity of binary search using recursion?
O(nlogn)
O(logn)
O(n)
O(n^{2})
What is the worst case complexity of binary search using recursion?
O(nlogn)
O(logn)
O(n)
O(n^{2})
Given an array arr = {45,77,89,90,94,99,100} and key = 99; what are the mid values(corresponding array elements) in the first and second levels of recursion?
90 and 99
90 and 94
89 and 99
89 and 94
Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?
5
2
3
4
What is the advantage of recursive approach than an iterative approach?
Consumes less memory
Less code and easy to implement
Consumes more memory
More code has to be written
What is the space complexity of the above implementation of Wagner-Fischer algorithm where "m" and "n" are the lengths of the two strings?
O(1)
O(n+m)
O(mn)
O(nlogm)
What is the time complexity of the Wagner-Fischer algorithm where "m" and "n" are the lengths of the two strings?
O(1)
O(n+m)
O(mn)
O(nlogm)
Which of the following lines should be inserted to complete the above code?
arr[i][j] = min
(min = arr[i-1][j-1] - 1);
min = arr[i-1][j-1].
(min = arr[i-1][j-1] + 1);
For which of the following pairs of strings is the edit distance maximum?
sunday & monday
monday & tuesday
tuesday & wednesday
wednesday & thursday
What is the edit distance between the strings "abcd" and "acbd" when the allowed operations are insertion, deletion and substitution?
1
2
3
4