Data Structure and Algorithm
ITM · Quiz · Fall 25
shared by MD. SOUROV HASAN
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
ITM 217: Data Structure and Algorithm
Quiz: 03,Time 40 min, Marks: 15
The Department of ITM is developing a new software tool to visualize hierarchical data such as organizational charts, directory structures, and decision-making processes. To build this tool efficiently, the developers need to store and manipulate binary trees in memory. During the design phase, the team must decide how the binary tree structure will be represented inside the computer so that basic operations can be performed efficiently. They are considering two common approaches for storing binary trees in memory and want a detailed understanding of each method before finalizing the design.
Question 1:
I. Explain these two methods of representing a binary tree in memory with clear, detailed descriptions and suitable examples. Marks: 6
II. Find the Height and Depth of each node by considering the figure 1.1 Marks: 2
[Figure: Binary tree with root node R. R has left child A and right child B. A has left child C and right child D. B has left child E and right child F. F has left child G.]
Question 2: Marks: 7
Consider the following queue of characters, where QUEUE is a circular array with 8 memory cells (indices 0-7) FRONT = 3, REAR = 5
QUEUE: __, __, __, E, F, G, __, __
(Here "__" represents an empty memory cell.)
Describe the state of the circular queue after each of the following seven operations is performed. Show the queue clearly after every step with front and rear calculation.
Operations to be performed:
(a) Insert K into the queue.
(b) Delete two letters from the queue.
(c) Insert M, N into the queue.
(f) Delete two letters.
(g) Insert S into the queue.