File tree Expand file tree Collapse file tree 5 files changed +34
-2
lines changed Expand file tree Collapse file tree 5 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,5 @@ fit into main memories. Historically, when data was primarily stored on
35
35
magnetic tape, versions of bottom up merge sort were absolutely essential.
36
36
There are recursive "top down" versions of merge sort, shown elsewhere.
37
37
There is also a "natural" merge sort which utilises already sorted runs,
38
- also shown elsewhere
38
+ also shown elsewhere.
39
39
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ into a grandchild of a node. Why can't it be caused by just adding a
28
28
new child to a node?
29
29
30
30
In the worst case for simple binary trees, every node except one has a
31
- single chlild . Find some worst case AVL trees.
31
+ single child . Find some worst case AVL trees.
32
32
33
33
The AIA insertion code is recursive. What possible ways are there to
34
34
write a non-recursive version?
Original file line number Diff line number Diff line change @@ -20,3 +20,14 @@ Geeks for Geeks Link: [**Iterative Merge Sort**][G4GLink]
20
20
21
21
[ G4GLink ] : https://www.geeksforgeeks.org/iterative-merge-sort/
22
22
23
+
24
+ ## Exercises/Exploration
25
+
26
+ Compare and contrast the sequence of merge operations performed by
27
+ top-down and bottom-up merge sort when the number of elements to be
28
+ sorted is a power of two.
29
+
30
+ Compare and contrast the sequence of merge operations performed by
31
+ bottom-up and natural merge sort when a) the input is reverse-sorted and
32
+ b) the input is sorted.
33
+
Original file line number Diff line number Diff line change @@ -20,3 +20,14 @@ Happy Coders Link: [**Natural Merge Sort**][HCLink]
20
20
21
21
[ HCLink ] : https://www.happycoders.eu/algorithms/merge-sort/#Natural_Merge_Sort
22
22
23
+
24
+ ## Exercises/Exploration
25
+
26
+ Compare and contrast the sequence of merge operations performed by
27
+ bottom-up and natural merge sort when a) the input is reverse-sorted and
28
+ b) the input is sorted.
29
+
30
+ This version of merge sort adapts well to partially sorted input. Can
31
+ you come up with a version of merge sort that adapts well to both
32
+ partially sorted and partially reverse-sorted input?
33
+
Original file line number Diff line number Diff line change @@ -20,3 +20,13 @@ Geeks for Geeks Link: [**Merge Sort**][G4GLink]
20
20
21
21
[ G4GLink ] : https://www.geeksforgeeks.org/merge-sort/
22
22
23
+
24
+ ## Exercises/Exploration
25
+
26
+ Compare and contrast the sequence of merge operations performed by
27
+ top-down and bottom-up merge sort when the number of elements to be
28
+ sorted is a power of two.
29
+
30
+ Compare and contrast the structure of top-down merge sort with that of
31
+ quicksort.
32
+
You can’t perform that action at this time.
0 commit comments