Dsa Quiz-2 Set-2
Dsa Quiz-2 Set-2
Dsa Quiz-2 Set-2
Option/Ques 1 2 3 4 5 6 7 8 9 10
a.
b.
c.
d.
Note: All Questions are Mandatory. Write the reason for each question in the space provided (Max. Marks = 10)
1. In the worst case, the number of a. Returns the original linked list
comparisons needed to search a singly b. Returns the linked list after reversing it
linked list of length n for a given element c. Returns the linked list containing
will be …. elements at odd nodes
a. O (logn) d. None of above
b. O (n)
c. O (1)
d. None
b. 2,7
c. 1,3
5. What are the time complexities of finding 8th d. 5,2
element from beginning and 8th element
from end in a singly linked list? Let n be the
number of nodes in linked list, you may
assume that n > 8.
9. A stack has a capacity of 5 and currently has 3
a. O(1) and O(n) elements in it. What is the maximum number
b. O(1) and O(1) of elements that can be pushed onto the
c. O(n) and O(1) stack?
d. O(n) and O(n) a. 2
b. 3
c. 5
d. None