• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 34 páginas
Notas de lectura

Data structure & algorithms (Heap sorting notes)

Document preview thumbnail
Vista previa 4 fuera de 34 páginas

This document is a comprehensive guide to Heap Sorting, a crucial sorting algorithm in computer science. It covers the key characteristics and types of heaps, including min-heap and max-heap. The document details essential heap operations such as insertion and deletion, as well as the process of heapify. It also explores the practical applications of heaps, their implementation, and includes a detailed explanation of how heap sort works. Additionally, the document may include relevant C++ files. This is a valuable resource for students studying data structures and algorithms.

Vista previa del contenido

Data Structures and Algorithm
(CC-2042)
Lecture 27
E N G R. D R B I L A L A S H FA Q A H M E D
S C H O O L O F S Y S T E M S A N D T E C H N O LO GY ( S S T )
C O M P U T E R S C I E N C E FA C U LT Y

, Heap
A Heap is a specialized binary tree
based data structure that satisfies
heap property. The heap property
be one of the following:
1. Max-Heap: The value of a pare
node is always greater than or
equal to the values of its child
nodes.
2. Min-Heap: The value of a pare
node is always less than or eq
the values of its child nodes.



09/06/2025 DS

,Key Characteristics
Key Characteristics
1.Complete Binary Tree:
•A heap is always a complete binary tree, meaning all levels except possibly
the last are fully filled, and the last level is filled from left to right.
2.Heap Property:
•Max-Heap: Parent >= Children
•Min-Heap: Parent <= Children
3.Index Representation:
•A heap can be efficiently represented using an array.
•For a node at index i:
•Parent: floor((i−1)/2)
•Left Child: 2i+1
•Right Child: 2i+2




09/06/2025 DS

, Types of Heaps
MAX-HEAP:THE LARGEST VALUE IS MIN-HEAP:THE SMALLEST VALUE IS
AT THE ROOT. AT THE ROOT.




09/06/2025 DS

Información del documento

Subido en
6 de septiembre de 2025
Número de páginas
34
Escrito en
2024/2025
Tipo
Notas de lectura
Profesor(es)
Dr.bilal ashfaq
Contiene
Class no.10
$11.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
1
Artículos
19
Última venta
-




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes