static boolean arePermutation ( char str1 [ ] , char str2 [ ] ) {
  int count1 [ ] = new int [ NO_OF_CHARS ] ;
  Arrays . fill ( count1 , 0 ) ;
  int count2 [ ] = new int [ NO_OF_CHARS ] ;
  Arrays . fill ( count2 , 0 ) ;
  int i ;
  for ( i = 0 ;
  i < str1 . length && i < str2 . length ;
  i ++ ) {
    count1 [ str1 [ i ] ] ++ ;
    count2 [ str2 [ i ] ] ++ ;
  }
  if ( str1 . length != str2 . length ) return false ;
  for ( i = 0 ;
  i < NO_OF_CHARS ;
  i ++ ) if ( count1 [ i ] != count2 [ i ] ) return false ;
  return true ;
}

static boolean arePermutation ( char str1 [ ] , char str2 [ ] ) { int count1 [ ] = new int [ NO_OF_CHARS ] ; Arrays . fill ( count1 , 0 ) ; int count2 [ ] = new int [ NO_OF_CHARS ] ; Arrays . fill ( count2 , 0 ) ; int i ; for ( i = 0 ; i < str1 . length && i < str2 . length ; i ++ ) { count1 [ str1 [ i ] ] ++ ; count2 [ str2 [ i ] ] ++ ; } if ( str1 . length != str2 . length ) return false ; for ( i = 0 ; i < NO_OF_CHARS ; i ++ ) if ( count1 [ i ] != count2 [ i ] ) return false ; return true ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) right: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))))) (expression_statement (update_expression (array_access array: (identifier) index: (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_access object: (identifier) field: (identifier)) right: (field_access object: (identifier) field: (identifier)))) consequence: (return_statement (false))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (return_statement (false)))) (return_statement (true))))