Question 1: [Multiple choice Questions -8 Marks]
1.1 Which of the following tree traversal technique visits root node first?
A. lnOrder Traversal
B. PostOrder Traversal
C. PreOrder Traversal
D. Level Order Traversal
1.2 A binary tree has n levels where level zero is the level of the root. And n denotes the last level.
Given that the root has only one child, what is the minimum number of leaves of level n of the
tree
A. 0
B. 1
C. -1
D. 4
1.3 Given a list of elements; 12, 16, 20, 27, 19 inserted into a data structure in that order. An
element is deleted using a basic data structure operation. If the deleted element is a 19 the
data structure can be a ?
A. Queue
B. Tree
C. Array
D. Stack
1.4 The following operations performed on a stack of size 5:
Push(DSA),pop(),push(ICG),push(DBF),pop(),push(OPS),pop,pop(),push(PRG)W. hich of the
following statement is correct?
A. Performed smoothly
B. Underflow
C. Overflow
D. Repeated operation
Question 2: [Stack/Queue/Linked-list -10 Marks]
2.1 Explain the difference between Queue and Stack? [4]
2.2 What do we call a condition that's occurs when a user try to remove an element from an
empty stack? [2]
2.3 Which of the following permutations can be obtained in the same order using a stack.
Assuming that input is the sequence. 5, 6, 7, 8, 9. In that order? [2]
i. 7, 8, 9, 5, 6
ii. 5, 9, 6, 7, 8
iii. 9, 8, 7, 5, 6
iv. 7, 8, 9, 6, 5
2.4 The following Five Namibian artist's names: The_Dogg, Gazza, TopCheri, Tate_Buti and
BigBen were pushed into a stack in that order. The stack is then popped out four names and
each name is inserted in a queue. The two names are deleted from the queue and pushed
back on the stack. Now one name is then popped from the stack. What is the popped name
of the artist? [2]
2