

MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
Minimum number of queues to implement stack is ___________ |
A. | 3 |
B. | 4 |
C. | 1 |
D. | 2 |
Answer» D. 2 | |
2. |
Which of the following data structures can be used for parentheses matching? |
A. | n-ary tree |
B. | queue |
C. | priority queue |
D. | stack |
Answer» E. | |
3. |
Consider these functions:push() : push an element into the stackpop() : pop the top-of-the-stack elementtop() : returns the item stored in top-of-the-stack-nodeWhat will be the output after performing these sequence of operations |
A. | 20 |
B. | 4 |
C. | stack underflow |
D. | 5View Answer |
Answer» E. | |
4. |
What does ‘stack overflow’ refer to? |
A. | accessing item from an undefined stack |
B. | adding items to a full stack |
C. | removing items from an empty stack |
D. | index out of bounds exception |
Answer» C. removing items from an empty stack | |
5. |
What does the following function do? |
A. | pop |
B. | delete the top-of-the-stack element |
C. | retrieve the top-of-the-stack element |
D. | push operationView Answer |
Answer» D. push operationView Answer | |
6. |
Which of the following statements are not correct with respect to Singly Linked List(SLL) and Doubly Linked List(DLL)? |
A. | Complexity of Insertion and Deletion at known position is O(n) in SLL and O(1) in DLL |
B. | SLL uses lesser memory per node than DLL |
C. | DLL has more searching power than SLL |
D. | Number of node fields in SLL is more than DLL |
Answer» E. | |
7. |
What is the best case time complexity of deleting a node in a Singly Linked list? |
A. | O (n) |
B. | O (n2) |
C. | O (nlogn) |
D. | O (1) |
Answer» E. | |
8. |
pop$ |
A. | delete the top-of-the-stack element |
B. | retrieve the top-of-the-stack element |
C. | none of the mentioned |
Answer» D. | |
9. |
Which of the following statements are correct with respect to Singly Linked List(SLL) and Doubly Linked List(DLL)? |
A. | Complexity of Insertion and Deletion at known position is O(n) in SLL and O(1) in DLL |
B. | SLL uses lesser memory per node than DLL |
C. | DLL has more searching power than SLL |
D. | All of the mentioned |
Answer» E. | |
10. |
What is the complexity of searching for a particular element in a Singly Linked List? |
A. | O(n) |
B. | O(1) |
C. | logn |
D. | nlogn |
Answer» B. O(1) | |