-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheap_arrangements.txt
41 lines (36 loc) · 974 Bytes
/
heap_arrangements.txt
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
Draw all of the diferent heaps that can be made from the five keys A B C D E,then draw all the different heaps that can be made from the five keys A A A B B.
For keys A B C D E:
starting with index = 1. The children of root whose index is at x would occur at the index 2*x and 2*x+1.
For max priority queue, the queue arrangement would be
E
' '
' '
D B
' '
' '
A C
For min priority queue:
A
' '
' '
B C
' '
' '
D E
For keys A A A B B
max priority queue:
B
' '
' '
B A
' '
' '
A A
min prioriry queue:
A
' '
' '
A A
' '
' '
B B