Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean isPostOrder(int[] array) {
- int root = array[array.length - 1];
- int i = 0;
- while(array[i] < root) {
- i++;
- }
- while(array[i] > root) {
- i++;
- }
- return i == array.length - 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement