title | date | draft | tags | categories | |||
---|---|---|---|---|---|---|---|
Algorithm4 Java Solution 2.2.02 |
2019-10-08 01:57:49 +0800 |
false |
|
|
Give traces, in the style of the trace given with ALGORITHM 2.4,showing how the keys E A S Y Q U E S T I O N are sorted with top-down merge sort.
code:
/Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=62045:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/gdhu/projects/Algorithms4/out/production/Algorithms4:/Users/gdhu/projects/Algorithms4/lib/hamcrest-core-1.3.jar:/Users/gdhu/projects/Algorithms4/lib/junit-4.8.jar:/Users/gdhu/projects/Algorithms4/lib/gson-2.8.2.jar:/Users/gdhu/projects/Algorithms4/lib/guava-29.0-jre.jar Ch_2_2.Ex_2_2_02
E A S Y Q U E S T I O N
merge(a, 0, 0, 1) A E
merge(a, 0, 1, 2) A E S
merge(a, 3, 3, 4) Q Y
merge(a, 3, 4, 5) Q U Y
merge(a, 0, 2, 5) A E Q S U Y
merge(a, 6, 6, 7) E S
merge(a, 6, 7, 8) E S T
merge(a, 9, 9,10) I O
merge(a, 9,10,11) I N O
merge(a, 6, 8,11) E I N O S T
merge(a, 0, 5,11) A E E I N O Q S S T U Y
A E E I N O Q S S T U Y