Professional Documents
Culture Documents
co
1. Consider You Have A Stack Whose Elements In It Are As Follows.5 4 3 2
b.
A. Push(pop()), push(6), push(pop())
hu
B. Push(pop()), push(6)
C. Push(pop()), push(pop()), push(6)
e
Push(6)
te
D.
Correct Answer:
tu
A. Push(pop()), push(6), push(pop())
k.
2. Which Of The Following Application Makes Use Of A Circular Linked List?
an
A. Undo operation in a text editor
B. Recursive function calls
C. Allocating CPU to resources
nb
tio
D. All of the mentioned
Correct Answer:
es
A. 1
s
tp
B. 2
C. 3
ht
D. 4
Correct Answer:
A. 1
A. In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes
must be removed from end
B. In push operation, if new nodes are inserted at the beginning, then in pop operation, nodes must be
removed from the beginning
C. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed
from end
D. None of the mentioned
Copyright © 2022
25 Question Set For Abstract Data Types in Data Structures and Algorithms
Correct Answer:
co
A. In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must
be removed from end
b.
5. What Does ‘stack Overflow' Refer To?
hu
A. accessing item from an undefined stack
e
B. adding items to a full stack
te
C. removing items from an empty stack
tu
D. index out of bounds exception
k.
Correct Answer:
B. adding items to a full stack
an
6. What Data Structure Would You Mostly Likely See In A Non Recursive Implementation Of A Recursive
nb
Algorithm?
A. Linked List
tio
B. Stack
C. Queue
es
D. Tree
qu
Correct Answer:
B. Stack
://
7. What Would Be The Asymptotic Time Complexity To Find An Element In The Linked List?
s
A. O(1)
tp
B. O(n)
ht
C. O(n2)
D. None of the mentioned
Correct Answer:
B. O(n)
8. Consider A Small Circular Linked List. How To Detect The Presence Of Cycles In This List Effectively?
A. Keep one node as head and traverse another temp node till the end to check if its ‘next points to head
B. Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer
advancing by one node at a time
C. Cannot determine, you have to pre-define if the list contains cycles
D. None of the mentioned
Copyright © 2022
25 Question Set For Abstract Data Types in Data Structures and Algorithms
Correct Answer:
co
B. Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer advancing by
one node at a time
b.
9. ‘Array Implementation Of Stack Is Not Dynamic', Which Of The Following Statements Supports This Argument?
hu
A. space allocation for array is fixed and cannot be changed during run-time
e
B. user unable to give the input for stack operations
te
C. a runtime exception halts execution
tu
D. all of the mentioned
k.
Correct Answer:
A. space allocation for array is fixed and cannot be changed during run-time
an
10. What Is The Time Complexity To Insert A Node Based On Position In A Priority Queue?
nb
A. O(nlogn)
B. O(logn)
tio
C. O(n)
es
D. O(n2)
Correct Answer:
qu
C. O(n)
11. Entries In A Stack Are “ordered”. What Is The Meaning Of This Statement?
://
A. Easy to implement
B. Processes with different priority can be efficiently handled
C. Applications with differing requirements
D. All of the mentioned
Correct Answer:
D. All of the mentioned
Copyright © 2022
25 Question Set For Abstract Data Types in Data Structures and Algorithms
13. Given Only A Single Array Of Size 10 And No Other Memory Is Available. Which Of The Following Operation Is
co
Not Feasible To Implement (Given Only Push And Pop Operation)?
b.
A. Push
hu
B. Pop
C. Enqueue
e
D. Returntop
te
Correct Answer:
C. Enqueue
tu
k.
14. What Is The Space Complexity Of A Linear Queue Having N Elements?
an
A. O(n)
B. O(nlogn)
nb
C. O(logn)
D. O(1)
tio
Correct Answer:
A. O(n)
es
A. Queue
Stack
://
B.
C. Array
s
D. List
tp
Correct Answer:
ht
B. Stack
A. 600
B. 350
C. 650
D. 588
Correct Answer:
B. 350
17. Which Of The Following Sorting Algorithms Can Be Used To Sort A Random Linked List With Minimum Time
Complexity?
Copyright © 2022
25 Question Set For Abstract Data Types in Data Structures and Algorithms
A. Insertion Sort
co
B. Quick Sort
b.
C. Heap Sort
D. Merge Sort
hu
Correct Answer:
D. Merge Sort
e
te
18. A Double-ended Queue Supports Operations Like Adding And Removing Items From Both The Sides Of The
Queue. They Support Four Operations Like AddFront(adding Item To Top Of The Queue), AddRear(adding Item To
tu
The Bottom Of The Queue), RemoveFront(removing Item From The Top Of The Queue) And
k.
RemoveRear(removing Item From The Bottom Of The Queue). You Are Given Only Stacks To Implement This Data
Structure. You Can Implement Only Push And Pop Operations. What's The Time Complexity Of Performing
an
AddFront And AddRear? (Assume ‘m' To Be The Size Of The Stack And ‘n' To Be The Number Of Elements)
nb
A. O(m) and O(n)
B. O(1) and O(n)
tio
C. O(n) and O(1)
D. O(n) and O(m)
es
Correct Answer:
B. O(1) and O(n)
qu
19. What Is The Time Complexity Of Inserting A Node In A Doubly Linked List?
://
A. O(nlogn)
s
B. O(logn)
tp
C. O(n)
ht
D. O(1)
Correct Answer:
C. O(n)
A. A low priority process might have to wait indefinitely for the CPU
B. If the system crashes, the low priority systems may be lost permanently
C. Interrupt handling
D. None of the mentioned
Correct Answer:
C. Interrupt handling
Copyright © 2022
25 Question Set For Abstract Data Types in Data Structures and Algorithms
21. Given Pointer To A Node X In A Singly Linked List. Only One Pointer Is Given, Pointer To Head Node Is Not
co
Given, Can We Delete The Node X From Given Linked List?
b.
A. Possible if X is not last node
hu
B. Possible if size of linked list is even
C. Possible if size of linked list is odd
e
D. Possible if X is not first node
te
Correct Answer:
A. Possible if X is not last node
tu
k.
22. What Is The Value Of The Postfix Expression 6 3 2 4 + – *:
an
A. Something between -5 and -15
B. Something between 5 and -5
nb
C. Something between 5 and 15
D. Something between 15 and 100
tio
Correct Answer:
D. Something between 15 and 100
es
23. In The Worst Case, The Number Of Comparisons Needed To Search A Singly Linked List Of Length N For A
qu
Given Element Is
A. log2 n
://
B. n?2
s
C. log2 n – 1
tp
D. n
ht
Correct Answer:
D. n
24. What Happens When You Pop From An Empty Stack While Implementing Using The Stack ADT In Java?
A. Undefined error
B. Compiler displays a warning
C. EmptyStackException is thrown
D. NoStackException is thrown
Correct Answer:
C. EmptyStackException is thrown
Copyright © 2022
25 Question Set For Abstract Data Types in Data Structures and Algorithms
A. + pq – *rt
co
B. – +pqr * t
b.
C. – +pq * rt
D. – + * pqrt
hu
Correct Answer:
C. – +pq * rt
e
te
tu
k.
an
nb
tio
es
qu
s ://
tp
ht
Copyright © 2022