TUTORIAL-8
U24IT302 Branch
Course Code / Name IT
Advanced Data Structures
Semester III Section 1&2
Tutorial Sheet posted Tutorial Class 22-09-2025 to
21.09.2025
in course web on Scheduled on 27-09-2025
Topics Covered Heap Tree: Representation of heap, Operations on a heap tree-
insertion, deletion, Heap sort
S. No Tutorial Problem CO CDLL
Batch-1
a) What is a heap tree data structure (R)-[2]
1 CO2 Ap
b) Show the heapify-up operation works after inserting a new
element into a heap. (U)- [3]
c) Apply heap sort on the array [12, 11, 13, 5, 6, 7] , arrange the
elements in ascending order and show the sorted output (Ap)-[5]
a) Define the property of a max heap (R) –[2]
2 CO2 Ap
b) Explain the difference between a max heap and a min heap with
examples (U)- [3]
c) Build a max heap for the following elements 10, 30, 15, 40, 5, 7, 60
and show the array representation (Ap)-[5]
3 a) Construct a max heap in C and perform insertion and deletion CO2 Ap
operations on it (Ap)- [5]
b) Develop a C program on heap sort (Ap)-[5]
Batch-2
a) List two types of heap trees (based on ordering property) (R) –[2]
4 CO2 Ap
b) Build a min heap for the following elements 60, 40, 30, 10, 5, 7, 15
and show the array representation (U)-[3]
c) Construct a min heap in C and perform insertion and deletion
operations on it (Ap)-[5]
a) What is the time complexity of inserting an element into a heap?
5 CO2 Ap
(R) –[2]
b) Compare and contrast heap sort with quicksort in terms of time
complexity and stability (Ap)-[3]
c) Make use of heap sort algorithm arrange the following elements in
descending order. 14, 45, 23, 78, 33, 23, 46, 56 (Ap)- [5]
a) Name any two applications of heap data structure (U)-[3]
6 CO2 Ap
b) - Scenario: A hospital emergency room needs to prioritize
patients based on the severity of their condition.
- Solution: Implement a priority queue using a heap tree, where
patients are assigned a priority based on their condition. The
patient with the highest priority (i.e., the most severe condition)
is treated first. [Real time scenario- (Ap)-[7]]
Practice Purpose
Apply the heap sort on the following elements 5 9 2 0 4 8 3
1 CO2 Ap
Construct min heap and max heap on the following elements
2 CO2 Ap
1, 3, 5, 7, 9, 2, 4, 6, 8, 0
Note: All students are required to write the answers to all the questions. As per the tutorial matrix, only three
students from each batch shall present their answers on the board.
Prepared By
M. Kishore R. Sandhya Rani
Assistant Professor Assistant Professor
Dept of I.T Dept of I.T