Driver code
public static void main ( String args [ ] ) { Node root = newNode ( 3 ) ; root . left = newNode ( 2 ) ; root . right = newNode ( 5 ) ; root . left . left = newNode ( 1 ) ; root . left . right = newNode ( 4 ) ; if ( isBST ( root , null , null ) ) System . out . print ( " Is ▁ BST " ) ; else System . out . print ( " Not ▁ a ▁ BST " ) ; } }