L29 Python.pdf for the beginning of python

suryavardhanc8 1 views 22 slides Sep 12, 2025
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

This is an edition of python course of ultimate concept and it's fair and free to learn.
This is an edition of python course of ultimate concept and it's fair and free to learn.
This is an edition of python course of ultimate concept and it's fair and free to learn.
This is an edition...


Slide Content

CS & IT
ENGINEERING
DATA STRUCTURE
Binary Heap
SHAILENDRA SIR
GeeksforGeeks
JOIN TELEGRAM TO ENROLL

Binary Heap
• Binary Heap
• HeapifyProcedure
• Build Binary Heap
• Operation on Binary Heap

Binary Heap:

The height of any rooted tree is defined as the maximum number of edges in the
path from the root node to any leaf node.
Suppose a Min-Heap ??????stores 32 keys. The height of ??????is _____________.
(Answer in integer)

Q) Consider a binary min-heap containing 105 distinct elements. Let k be the index (in the
underlying array) of the maximum element stored in the heap. The number of possible
values of k is
A)53
B)52
C)27
D)1

Q)Which one of the following sequences when stored in an array at locations A[1], . . . , A[10]
forms a max-heap?
A)23, 17, 10, 6, 13, 14, 1, 5, 7, 12
B)23, 17, 14, 7, 13, 10, 1, 5, 6, 12
C)23, 17, 14, 6, 13, 10, 1, 5, 7, 15
D)23, 14, 17, 1, 10, 13, 16, 12, 7, 5

Q) Let H be a binary min-heap consisting of n elements implemented as an array. What is the
worst case time complexity of an optimal algorithm to find the maximum element in H?
A)Θ(1)
B)Θ(logn)
C)Θ(n)
D)Θ(nlogn)

Q) In a heap with n elements with the smallest element at the root, the7thsmallest element ban be found in
time

Q) Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree
is stored using the array representation of binary heap trees. Assuming that the array indices start
with 0, the 3rd largest element of the tree is stored at index _______.
Tags