The last attempt is wrong. It doesn't check the values in a perfect tree. For example,
will be considered sorted, and it is not!Code:4 2 6 1 8 5 7
The last attempt is wrong. It doesn't check the values in a perfect tree. For example,
will be considered sorted, and it is not!Code:4 2 6 1 8 5 7
Code - functions and small libraries I use
It’s 2014 and I still use printf() for debugging.
"Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson