Skip to content

Commit b671dc7

Browse files
authored
Revise heap diagrams and heapify examples
Updated heap diagrams and heapify examples in sorting notes.
1 parent 969784d commit b671dc7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

notes/sorting.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ We will sort the array:
618618
Binary tree view:
619619

620620
```
621+
Heap:
621622
4
622623
/ \
623624
10 3
@@ -628,6 +629,7 @@ Binary tree view:
628629
Heapify → Largest at top:
629630

630631
```
632+
Heap:
631633
10
632634
/ \
633635
5 3
@@ -648,6 +650,7 @@ Swap 10 ↔ 1 → largest (10) moves to correct final place.
648650
Heapify the reduced heap \[1,5,3,4]:
649651

650652
```
653+
Heap:
651654
5
652655
/ \
653656
4 3
@@ -668,6 +671,7 @@ Swap 5 ↔ 1.
668671
Heapify reduced heap \[1,4,3]:
669672

670673
```
674+
Heap:
671675
4
672676
/ \
673677
1 3
@@ -686,6 +690,7 @@ Swap 4 ↔ 3.
686690
Heapify reduced heap \[3,1]:
687691

688692
```
693+
Heap:
689694
3
690695
/
691696
1

0 commit comments

Comments
 (0)