Skip to content

Instantly share code, notes, and snippets.

@scoutman57
Created May 26, 2015 08:11
Show Gist options
  • Save scoutman57/2d96b18eac1dbfae3f85 to your computer and use it in GitHub Desktop.
Save scoutman57/2d96b18eac1dbfae3f85 to your computer and use it in GitHub Desktop.
Binary Tree
/*
0
909
89098
7890987
678909876
56789098765
4567890987654
345678909876543
23456789098765432
1234567890987654321
*/
echo 0;
echo "<br>";
for ($i=9; $i >= 1; $i--) {
for ($j=$i; $j <= 9; $j++) {
echo $j;
}
echo 0;
for ($k=9; $k >= $i; $k--) {
echo $k;
}
echo "<br>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment