-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeaps.html
More file actions
84 lines (67 loc) · 3.23 KB
/
Heaps.html
File metadata and controls
84 lines (67 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.5.0.js"></script>
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" href="Arrays.css">
<title>Heaps</title>
</head>
<body>
<nav>
<input type="checkbox" id="check">
<label for="check" class="checkbtn">
<i class="fas fa-bars"></i>
</label>
<label class="logo">Codeinfo</label>
<ul>
<li><a class="active" href="index.html">Home</a></li>
<li><a href="Arrays.html">Arrays</a></li>
<li><a href="Stacks.html">Stacks</a></li>
<li><a href="queues.html">Queues</a></li>
<li><a href="LinkedList.html">Linkedlist</a></li>
<li><a href="Heaps.html">Heaps</a></li>
<li><a href="Trees.html">Trees</a></li>
</ul>
</nav>
<div class = "matter">
<h3>Heaps</h3> <br>
<p>A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Generally, Heaps can be of two types:</p> <br>
<pre>
1. Min Heap
2. Max Heap
</pre> <br>
<h3>Min Heap</h3> <br>
<p>
In a Min-Heap the key present at the root node must be minimum among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.
</p> <br>
<img width = "300" src="https://miro.medium.com/max/442/0*o4Uh6ggzDmggIArZ.png" alt="Min Heap" style = "align-items: center;"> <br>
<h3>Implementation</h3> <br>
<p>Min Heap can be Implemented using arrays or it can be implemented using doubly linked list</p> <br>
<h4>Array Implementation</h4> <br>
<script src="https://gist.github.com/hrudai2002/08dbfef5e25bd23eb7cc889f85c48d11.js"></script> <br>
<h3>Max Heap</h3> <br>
<p>In a Max-Heap the key present at the root node must be greatest among the keys present at all of it’s children. The same property must be recursively true for all sub-trees in that Binary Tree.</p> <br>
<img width = "300" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQvJGF_sRtWAmIjQybTl3EPvhxv5Ja6TonuvQ&usqp=CAU" alt=""> <br>
<h3>Implementation</h3> <br>
<p>Max Heap can be Implemented using arrays or it can be implemented using doubly linked list</p> <br>
<h4>Array Implementation</h4> <br>
<script src="https://gist.github.com/hrudai2002/d32e30f665b887405673de1790dcc80d.js"></script> <br>
<h3>Problem on Heaps</h3> <br>
<p>Work on some problems to get know more about heaps.</p>
<a href="https://450dsa.com/heap">Heaps</a>
<footer>
<div class="footer-content">
<h3>codeinfo</h3>
<p>Learn to code with our beginner-friendly tutorials and examples. Read tutorials, try examples, write programs, and learn to code.</p>
<ul class="socials">
</ul>
</div>
<div class="footer-bottom">
<p>copyright ©2021 codeinfo. designed by <span>nithin</span></p>
</div>
</footer>
</body>
</html>