###### 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(n

^{2})

I and II | |

II and III | |

I and IV | |

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.

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.

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.

Subscribe

Login

0 Comments