Professional Documents
Culture Documents
Exam For Boderline Scores
Exam For Boderline Scores
1. Data structure for circular array queue can be represented by following declaration.
struct Q{
int front,rear;
int Qa[Max];
};
Although it is easy to implement, the model has one disadvantage.
a. What is the disadvantage of the above model ? Justify your answer!
b. Could the drawback be resolved ? How ?
Where Enqueue’s arguments: dat – data to be inserted; pr – priority of the data; Q – the
circular queue structure
3. move_q_down shown the above code is a function to move existing data before the new
data is inserted. Please write the correct code for the function.
4. In size_base trace that is shown in Tree.pdf, there exists print subroutine that takes
three arguments, node n, depth of the node, size of (memory). Then try to figure out the
code for such sub routine.