Skip to content

Instantly share code, notes, and snippets.

@jeffomatic
Created August 22, 2012 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffomatic/3421955 to your computer and use it in GitHub Desktop.
Save jeffomatic/3421955 to your computer and use it in GitHub Desktop.
Binary tree output 3
values: [3, 0, 2, 3, 0, 5, 7, 9, 7, 4, 4, 4, 4, 6, 8, 3, 6, 6, 3,
9, 3, 9, 1, 6, 7, 7, 3, 1, 7, 4, 7, 9, 8, 8, 6, 6, 0, 0, 3, 6, 1,
1, 0, 5, 3, 9, 5, 8, 4, 1, 0, 7, 9, 1, 6, 4, 0, 8, 8, 9, 7, 2, 9,
5, 8]
⌜·············3·⌝
⌜0···········⌝ ⌜3············⌝
0 ⌜·····2⌝ 3 ⌜·····5············⌝
⌜···1·⌝ 2 ⌜4·⌝ ⌜7·············⌝
⌜0·⌝ ⌜1·⌝ ⌜···4 ⌜4·⌝ ⌜······7 ⌜······9·⌝
0 ⌜0⌝ 1 ⌜1⌝ ⌜3·⌝ 4 ⌜4⌝ ⌜6·⌝ ⌜····8·⌝ ⌜9·⌝
0 0 1 1 3 ⌜3⌝ 4 4 ⌜·6 ⌜6·⌝ ⌜7·⌝ ⌜8·⌝ 9 ⌜9·⌝
3 3 ⌜5⌝ 6 ⌜6⌝ 7 ⌜7⌝ 8 ⌜8⌝ 9 ⌜9⌝
5 5 6 6⌝ 7 7⌝ 8 8⌝ 9 9
6 7 8
sorted: [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
9, 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment