NEW
Font size
WorksheetsDSA5541 Quiz 1 TRI 2210
Total questions: 20
Worksheet time: 3600secs
Mathematical-model with a collection of operations defined on that model is called
Data Structure
Abstract Data Type
Primitive Data Type
Algorithm
The postfix form of the expression (A+ B)*(C*D - E)*F / G is
AB+ CD*E - FG /**
AB + CD* E - F **G /
AB + CD* E - *F *G /
AB + CDE * - * F *G /
A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a
queue.
stack.
tree.
linked list.
What is the postfix form of the following prefix expression -A/B*C/DE
ABCDE/*/-
A-BCDE/*/-
ABC/ED*/-
A-BCDE/*/
The data structure required to evaluate a postfix expression is
queue
stack
array
linked-list
The data structure required to check whether an expression contains balanced parenthesis is
Stack
Queue
Tree
Array
What data structure would you mostly likely see in a nonrecursive implementation of a recursive algorithm?
Stack
Linked list
Queue
Trees
The postfix form of A*B+C/D is
*AB/CD+
AB*CD/+
A*BC+/D
ABCD+/*
Let the following circular queue can accommodate maximum six elements with the following data
front = 2 rear = 4
current elements : ‘L’, ‘M’, ‘N’
What will happen after ADD ‘O’ operation takes place?
front = 2 rear = 5
front = 3 rear = 5
front = 3 rear = 4
front = 2 rear = 4
Assume that a queue is available for enqueue and dequeue elements. Given an inputs are A, B, C. Give the output sequence of elements if the leftmost element
given is at rear position and the rightmost element is at front position in the queue.
BCA
ABC
CBA
BAC
A queue is a,
Linear tree.
LIFO (Last In First Out) list.
Ordered array.
FIFO (First In First Out) list.
Which of the following operations is backward manner performed by linked list?
New node are always inserted at the end.
New node is always inserted at the beginning.
Pointer head must always point to the last node in the list or else the rest of the nodes will be lost.
Pointer head must always point to the current node in the list or else the rest of the nodes will be lost.
Q13. The prefix form of A-B / (C * D ^ E) is,
-/*^ACBDE
-ABCD*^DE
-A/B*C^DE
-A/BC*^DE
The prefix form of an infix expression p + q - r * t is
+ pq - *rt
- +pqr * t
- +pq * rt
- + * pqrt
The equivalent prefix expression for the following infix expression (A+B)-(C+D*E)/F*G is
-+AB*/+C*DEFG
/-+AB*+C*DEFG
-/+AB*+CDE*FG
-+AB*/+CDE*FG
Convert the infix (a+b)*(c+d)/f into postfix
*a b + c d + f /
a b + c d + * f /
a b + c d +/ * f
+a b + c d / * f
Based on the diagram 1, values 40, 50 and 60 are push in the stack. Then there are two values pop out from the stack. What is the final answer for the topstack?
1
2
4
5
Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.
Based on the diagram 2, what is the final value for variable z?
7
4
3
14
Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.
Based on the diagram 2, what is the final value for variable *p?
7
4
3
14
Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.
Based on the diagram 2, what is the final value for variable array?
5,4
3,4
4,7
4,5
