Miscellaneous on Data Structure and Algorithms related Questions and Answers - Page 4

Question 31 : What will be the worst case time complexity of finding the sum of elements in a given range of (l,r) in an array of size n?
1. O(n)
2. O(l+r)
3. O(l-r)
4. O(r-l)
View Answer   Discuss with Members

Question 32 : Topological sort can be applied to which of the following graphs?
1. Undirected Cyclic Graphs
2. Directed Cyclic Graphs
3. Undirected Acyclic Graphs
4. Directed Acyclic Graphs
View Answer   Discuss with Members

Question 33 : Most Efficient Time Complexity of Topological Sorting is? (V – number of vertices, E – number of edges)
1. O(V + E)
2. O(V)
3. O(E)
4. None of the mentioned
View Answer   Discuss with Members

Question 34 : What will be the time complexity of the code to find a minimum element from an array of size n and uses square root decomposition(exclude pre processing time)?
1. O(√n)
2. O(n)
3. O(1)
4. O(n2)
View Answer   Discuss with Members

Question 35 : What is the average case time complexity of quickselect?
1. O(n log n)
2. O(n2)
3. O(n)
4. O(log n)
View Answer   Discuss with Members

Question 36 : What will be the worst case time complexity of finding the sum of elements in a given range of (l,r) in an array of size n when we use square root optimization?
1. O(n)
2. O(l+r)
3. O(√n)
4. O(r-l)
View Answer   Discuss with Members

Question 37 : Total how many iterations are required to find the sum of elements in a given range of (l,r) in an array of size n when we use square root optimization?
1. √n
2. 2*√n
3. 3*√n
4. n*√n
View Answer   Discuss with Members

Question 38 : What will be the auxiliary space complexity of the following code?
1. O(n)
2. O(1)
3. O(log n)
4. O(n log n)
View Answer   Discuss with Members

Question 39 : Which of the following is an alternative name of the quickselect algorithm?
1. quick sort
2. hoare's selection algorithm
3. tony's selection algorithm
4. kruskal's algorithm
View Answer   Discuss with Members

Question 40 : Quickselect is an in-place algorithm?
1. true
2. false
3.
4.
View Answer   Discuss with Members


View 31 - 40 of 49 Questions

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter