-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.txt
71 lines (71 loc) · 1.81 KB
/
sample.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
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
let h1 = [ Tree 0 1 [], Tree 1 2 [Tree 0 3 []], Tree 2 4 [Tree 0 5 [], Tree 1 6 [Tree 0 7 []] ] ]
let h2 = [ Tree 0 10 [], Tree 2 11 [Tree 0 12 [], Tree 1 13 [Tree 0 14 []] ] ]
mergeHeaps h1 h2
[
Tree {
rank = 2,
value = 1,
heap = [
Tree {
rank = 0,
value = 10,
heap = []
},
Tree {
rank = 1,
value = 2,
heap = [
Tree {
rank = 0,
value = 3,
heap = []
}
]
}
]
},
Tree {
rank = 3,
value = 4,
heap = [
Tree {
rank = 0,
value = 5,
heap = []
},
Tree {
rank = 1,
value = 6,
heap = [
Tree {
rank = 0,
value = 7,
heap = []
}
]
},
Tree {
rank = 2,
value = 11,
heap = [
Tree {
rank = 0,
value = 12,
heap = []
},
Tree {
rank = 1,
value = 13,
heap = [
Tree {
rank = 0,
value = 14,
heap = []
}
]
}
]
}
]
}
]