static boolean isBSTUtil ( Node root , int prev ) {
  if ( root != null ) {
    if ( ! isBSTUtil ( root . left , prev ) ) return false ;
    if ( root . data <= prev ) return false ;
    prev = root . data ;
    return isBSTUtil ( root . right , prev ) ;
  }
  return true ;
}

static boolean isBSTUtil ( Node root , int prev ) { if ( root != null ) { if ( ! isBSTUtil ( root . left , prev ) ) return false ; if ( root . data <= prev ) return false ; prev = root . data ; return isBSTUtil ( root . right , prev ) ; } return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (null_literal))) consequence: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (identifier))))) consequence: (return_statement (false))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (identifier))) consequence: (return_statement (false))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (return_statement (method_invocation name: (identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)) (identifier)))))) (return_statement (true))))