NIC-NIELIT STA 2020
October 15, 2023
Digital-Logic-Design
October 15, 2023
NIC-NIELIT STA 2020
October 15, 2023
Digital-Logic-Design
October 15, 2023

Algorithms

Question 31

Which of the following statements is true?

    I. As the number of entries in a hash table increases, the number of collisions increases.
    II. Recursive programs are efficient
    III. The worst case complexity for Quicksort is O(n2)
A
I and II
B
II and III
C
I and IV
D
I and III
Question 31 Explanation: 
Binary search using linked list is not efficient as it will not give O(log n), because we will not be able to find the mid in constant time. Finding mid in linked list takes O(n) time.
Recursive program requires stack for storing the function state. Any recursive program can be rewritten as an iterative one. Advantage of recursion is “less programming effort”, while it always lags behind iterative one in terms of performance.
Correct Answer: D
Question 31 Explanation: 
Binary search using linked list is not efficient as it will not give O(log n), because we will not be able to find the mid in constant time. Finding mid in linked list takes O(n) time.
Recursive program requires stack for storing the function state. Any recursive program can be rewritten as an iterative one. Advantage of recursion is “less programming effort”, while it always lags behind iterative one in terms of performance.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!