Quiz 1 DS
Quiz 1 DS
Quiz # 1
Question 1:[3]
A. Suppose a queue is maintained with N=12 memory cells. Find the number of elements in queue if
a. FRONT = 3, REAR = 9
b. FRONT = 9, REAR = 4
c. FRONT = 4, REAR = 4
Question 2: [2]
Suppose STACK is allocated N=6 memory cell and initially STACK is empty ,or in other words, TOP=0.Find the output of the
following module.
4.Return.
Question 3: [0.5+0.5+0.5+0.5=2]
1. (A + B) * (C + D)
2. ((A/B-C+D)*(E-A))/C
3. ((A/(B-C+D)*(E-A)*C-D
4. (A + B) * C - (D - E) * (F + G)
Question 4:[0.5+0.5+0.5+0.5=2]
For given 1-5, indicate which structure would be a more suitable choice for each of the following applications by marking
them as follows:
A. Stack B. Queue C. Tree D. Binary search tree E. Graph
1. A bank simulation of its teller operation to see how waiting times would be affected by adding another teller. ( )
2. A program to receive data that is to be saved and processed in the reverse order. ( )
3. An electronic address book ordered by name. ( )
4. A word processor to have a PF key that causes the preceding command to be redisplayed. Every time the PF key is pressed,
the program is to show the command that preceded the one currently displayed. ( )
Question 5:[1]
Would it makes a sense to call a stack:
1. A LILO structure?
2. A FILO Structure?