NEW
Font size
WorksheetsDSA #01
Total questions: 20
Worksheet time: 15mins
Principle of Stack
LILO
FILO
LIFO
FIFO
Queue follows
FIFO
LIFO
FILO
LILO
ADT means
Abstract Define Type
Abstract Data Term
Additive Data Technique
Abstract Data Type
Convert the following infix into post fix. (a + b) * (c - d)
ab+*cd-
ab+cd*-
ab+cd-*
ab+cd*-
Convert the following infix into prefix. a+b/d
+/abd
a+/bd
+a/bd
/+abd
convert the following infix into post fix. (a+b/e)*(d+f)
*/+abe+df
*+abe/+df
ab+e/df+*
abe+/df+*
what happens next?
push 2; push -1; push 54; pop; push 71; pop; push 100; pop
-1, 2
2, -1
empty
full
Process of inserting an element in stack is called ____________
Create
Push
Pop
Top
What is the value of the postfix expression 6 3 2 4 + – *:
1
14
74
-18
To represent hierarchical relationship between elements, Which data structure is suitable?
Queue
Tree
Graph
Priority
What happens if we try to pop from an empty stack?
Underflow
Overflow
Segmentation fault
No error
What is the drawback of using a simple queue using arrays?
Insertion is not possible
Memory is wasted
Deletion is not possible
Front and rear can’t be updated
Which data structure is used for converting infix expression to postfix expression?
Queue
Linked List
Stack
Tree
In infix to postfix conversion, how is operator precedence handled?
Operators with lower precedence are processed first
Precedence doesn’t matter in postfix
Operators with higher precedence are pushed to stack first
Operands are pushed based on precedence
How are operands handled in postfix expression evaluation?
Always added to a queue
Stored in a tree
Pushed to a stack
Ignored
What is the postfix evaluation result of the expression: 10 2 8 * + 3 -?
23
27
19
9
Which of the following is NOT true about postfix expressions?
Parentheses are not required
Evaluation can be done using a stack
Operands are written in the order they appear
Operators appear before their operands
Which of the following is the correct broad classification of data structures?
Static and Dynamic
Primitive and Non-Primitive
Linear and Non-Linear
Arrays and Linked Lists
What is the key feature that distinguishes linear from non-linear data structures?
Elements stored in fixed size
Elements are stored sequentially
Elements are accessed randomly
Elements are of same data type
Dynamic data structures are:
Allocated at compile time
Fixed in size
Allow flexible memory usage
Faster than arrays always
