1.
a. Give the inorder and postorder traversal sequences of the binary tree below.
[Figure: binary tree — root 1; children 2 (left) and 4 (right); 2 has left child 3; 4 has children 8 and 9.]
b. I have implemented a queue with a linked list, keeping track of a front pointer and a rear pointer. Use an example to show that both pointers will change during insertion into the EMPTY queue.
c. Explain 2 applications of a queue structure.
2.
a. The following postfix expression S and the initial values of the variables are:
S = A B − C + D E F − + ^
Assume that A = 5, B = 3, C = 2, D = 1, E = 3, F = 2. What would be the final output of the stack?
b. List and explain 5 data structure operations you know.
c. Give 2 applications of a stack structure.
3.
a. Use diagrams to differentiate between singly, doubly and circular linked lists.
b. If the characters 'F', 'E', 'D', 'C', 'B', 'A' are placed in a queue (in that order), and then removed one at a time, in what order will they be removed? (Show the state of the queue after each operation)
4.
a. The following list of names is assigned (in order) to a linear array INFO:
Mary, Jamil, Bashir, Pascal, Dahiru, Anna, Khalid, Nabil, Rukayya, Eileen
That is INFO[1] = Mary, INFO[2] = Jamil, …, INFO[10] = Eileen. Assign values to an array LINK and a variable START so that INFO, LINK and START form an alphabetical listing of the names.
b. A professor keeps a class list containing the following data for each student: Name, Registration Number, Course, Test scores, Final grade.
i. State the entity, attributes and entity set of the list.
ii. Describe the field values, records and file.
iii. Which attribute can serve as a primary key for the list?
5.
a. Consider the following queue of characters, where QUEUE is a circular array which is allocated six memory cells:
FRONT = 1, REAR = 3, QUEUE = −−, A, C, D, −−, −−
What is the state of the queue after performing the following operations?
F is added to the queue
two letters are deleted
K, L, M are added to the queue
Two letters are deleted
R is added to the queue
Two letters are deleted
S is added to the queue
Two letters are deleted
One letter is deleted
(Show the state of the queue after each operation)
b. Suppose you opened a notepad, a music player, an Excel sheet, and you are also doing your data structure programming simultaneously. Your OS implements which data structure for it?
c. List and explain 3 binary tree traversal algorithms.
6.
a. Write a short note on the following: i. Stack ii. Queue
b. Give the postfix expression of the infix expression A + (B * C − (D / E ^ F) * G) * H

