Driver code
public static void main ( String args [ ] ) { int arr [ ] = { 7 , 4 , 12 , 3 , 6 , 8 , 1 , 5 , 10 } ; int n = arr . length ; if ( levelOrderIsOfBST ( arr , n ) ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }