Skip to content

Commit c2d18dc

Browse files
shaontyshaonty
authored andcommitted
Heap README.md file add
1 parent 9907492 commit c2d18dc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Data Structure/Heap/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Heap
2+
3+
A **Heap** is a tree based data structure and it is a complete binary tree which satisfies the heap ordering property. The ordering can be one of two types:
4+
5+
the **min-heap property:** the value of each node is greater than or equal to the value of its parent, with the minimum-value element at the root.
6+
the **max-heap property:** the value of each node is less than or equal to the value of its parent, with the maximum-value element at the root.
7+
8+
**Basic Operations:**
9+
10+
Following are the basic operations supported by a list.
11+
12+
* **Insertion** − Adds an element at the max heap.
13+
14+
* **Deletion** − Deletes an element at the beginning of the heap.
15+
16+
* **Display** − Displays the complete heap.
17+
18+
* **Max** − Get the max element from the heap.
19+
20+
21+
#### Complexity Analysis
22+
Algorithm Average Worst case
23+
Space O(n) O(n)
24+
Search O(n) O(n)
25+
Insert O(1) O(log n)
26+
Delete O(log n) O(log n)
27+
Peek O(1) O(1)
28+
29+
### More on this topic
30+
- https://en.wikipedia.org/wiki/Heap_(data_structure)
31+
- https://www.hackerearth.com/practice/data-structures/trees/heapspriority-queues/tutorial/
32+
- https://www.geeksforgeeks.org/binary-heap/

0 commit comments

Comments
 (0)