0% found this document useful (0 votes)
15 views10 pages

Bank of Questions Data Structures - EyadReda

Uploaded by

omaranwer2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

Bank of Questions Data Structures - EyadReda

Uploaded by

omaranwer2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Bank of Questions Data Structures 2021 Data Structure

Multiple Choice Questions (MCQs):

1. Process of inserting an element in stack is called _______


a. Create
b. Push
c. Evaluation
d. Pop
2. Process of removing an element from stack is called ______
a. Create
b. Push
c. Evaluation
d. Pop
3. In a stack, if a user tries to remove an element from empty stack it
is__
a. Underflow
b. Empty collection
c. Overflow
d. Garbage Collection
4. Pushing an element into stack already having five elements and
stack size of 5, then stack becomes
a. Overflow
b. Crash
c. Underflow
d. User flow
5. Which of the following not applications may use a stack?
a. A parentheses balancing program
b. Tracking of local variables at run time
c. Compiler Syntax Analyzer
d. Data Transfer between two asynchronous process
6. What is the value of the postfix expression 6 3 2 4 + – *:
a. 1
b. 40
c. 74
d. -18
7. The postfix form of the expression (A+ B) *(C*D- E) *F / G is?
a. AB+ CD*E – FG /**
b. AB + CD* E – F **G /
c. AB + CD* E – *F *G /
d. AB + CDE * – * F *G /
8. The data structure required to check whether an expression
contains balanced parenthesis is?
a. Stack
b. Queue
c. Array
d. Tree
9. What data structure would you mostly likely see in a non-recursive
implementation of a recursive algorithm?
a. Linked List
b. Stack
c. Queue
d. Tree
10. The postfix form of A*B+C/D is?
a. *AB/CD+
b. AB*CD/+
c. A*BC+/D
d. ABCD+/*
11. Which data structure is needed to convert infix notation to postfix
notation?
a. Branch
b. Tree
c. Queue
d. Stack
12. The prefix form of A-B/ (C * D ^ E) is?
a. -/*^ACBDE
b. -ABCD*^DE
c. -A/B*C^DE
d. -A/BC*^DE
13. What is the result of the following operation? Top (Push (S, X))
a. X
b. X+S
c. S
d. XS
14. The prefix form of an infix expression (p + q) – (r * t) is?
a. + p q – *rt
b. – +p q r * t
c. – +p q * rt
d. – + * p q r t
15. Which data structure is used for implementing recursion?
a. Queue
b. Stack
c. Array
d. List

16. Convert the following infix expressions into its equivalent postfix
expressions (A+B D)/(E–F) +G
a. (A B D + E F – / G +)
b. (ABD + E F – / G +)
c. (A B D + E F/- G +)
d. (A B D E F + / – G +)
17. Which of the following statement(s) about stack data structure
is/are NOT correct?
a. Linked List are used for implementing Stacks
b. Top of the Stack always contain the new node
c. Stack is the FIFO data structure
d. Null link is present in the last node at the bottom of the stack
18. If the elements “A”, “B”, “C” and “D” are placed in a stack and are
deleted one at a time, what is the order of removal?
a. ABCD
b. DCBA
c. DCAB
d. ABDC
19. 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?
a. Queue
b. Stack
c. Tree
d. Linked list

20. A queue follows __________


a. FIFO (First in First Out) principle
b. LIFO (Last in First Out) principle
c. Ordered array
d. Linear tree
21. If the elements “A”, “B”, “C” and “D” are placed in a queue and are
deleted one at a time, in what order will they be removed?
a. ABCD
b. DCBA
c. DCAB
d. ABDC
22. A data structure in which elements can be inserted or deleted
at/from both the ends but not in the middle is?
a. Queue
b. Circular queue
c. Dequeue
d. Priority queue
23. A normal queue, if implemented using an array of size MAX_SIZE,
gets full when
a. Rear = MAX_SIZE – 1
b. Front = (rear + 1) mod MAX_SIZE
c. Front = rear + 1
d. Rear = front
24. Which of the following is not the type of queue?
a. Ordinary queue
b. Single ended queue
c. Circular queue
d. Priority queue
25. A linear collection of data elements where the linear node is given
by means of pointer is called?
a. Linked list
b. Node list
c. Primitive list
d. Unordered list
26. In linked list each node contains minimum of two fields. One field is
data field to store the data second field is?
a. Pointer to character
b. Pointer to integer
c. Pointer to node
d. Node
27. Which of the following properties is associated with a queue?
a. First in Last Out
b. First in First Out
c. Last in First Out
d. Last in Last Out
28. In linked list implementation of a queue, where does a new element
be inserted?
a. At the head of link list
b. At the center position in the link list
c. At the tail of the link list
d. At any position in the linked list
29. Identify the infix expression from the list of options given below.
a. a/b+(c-d)
b. a b c*+d +a b + c d + * c e – f -
c. a b – c –
d. + a b
30. Which of the following statement is incorrect with respect to
evaluation of infix expression algorithm?
a. Operand is pushed on to the stack
b. If the precedence of operator is higher, pop two operands and
evaluate
c. If the precedence of operator is lower, pop two operands and
evaluate
d. The result is pushed on to the operand stack
31. Evaluate the following statement using infix evaluation algorithm
and choose the correct answer. 1+2*3-2
a. 3
b. 6
c. 5
d. 4
32. Evaluate the following statement using infix evaluation algorithm
and choose the correct answer. 4*2+3-5/5
a. 10
b. 11
c. 16
d. 12
33. Which of the following is an example for a postfix expression?
a. a * b (c + d)
b. a b c * + d e - +
c. + a b
d. a + b – c

34. Which of the following is not an application of stack?


a. evaluation of postfix expression
b. conversion of infix to postfix expression
c. balancing symbols
d. line at ticket counter
35. What would be the Prefix notation for the given equation? (A * B) +
(C * D)
a. + * A B * C D
b. * + A B * C D
c. * * A B + C D
d. + * B A * C D
36. When an operand is read, which of the following is done?
a. It is placed on to the output
b. It is placed in operator stack
c. It is ignored
d. Operator stack is emptied
37. Which of the following is an infix expression?
a. (a + b) * (c + d)
b. a b + c *
c. + a b
d. a b c + *
38. What is the postfix expression for the corresponding infix
expression? A +b*c+(d*e)
a. a b c * + d e * +
b. a b c + * d e * +
c. a + b c * d e + *
d. a b c * + (d e) * +
39. What is the corresponding postfix expression for the given infix
expression? a * (b + c) / d
a. a b * + c d /
b. a b + * c d /
c. a b c * +/ d
d. a b c + * d /

Mark the following statements as true or false: -

1. Linked list nodes are normally stored contiguously in memory ( )


2. A linked list is a dynamic data structure ( )
3. To traverse a linked list, the program must use a pointer different
than the head pointer of the list, initialized to the first node in the
list ( )
4. A stack is a data structure in which the items are added and deleted
from one end only. ( )
5. A stack is a Last in First Out (LIFO) data structure ( )
6. A stack can be implemented as an array or a linked list. ( )
7. The middle elements of a stack should not be accessed directly ( )
8. Stacks are restricted versions of arrays and linked lists ( )
9. In a linked list, the order of the elements is determined by the order
in which the nodes were created to store the elements. ( )
10. A single linked list can be traversed in one direction. ( )
11. A stack is referred to as a last-in, first-out (LIFO) data structure ( )
12. A stack is a First in First Out (FIFO) data structure. ( )
13. A queue is referred to as a Last Input First Output data structure ( )

You might also like