public int search(Vector<TreeNode> vct,String target){
  if (vct == null) {
    return -1;
  }
  for (int i=0; i < vct.size(); i++) {
    if (target.equals(vct.elementAt(i).value)) {
      return i;
    }
  }
  return -1;
}

public int search ( Vector < TreeNode > vct , String target ) { if ( vct == null ) { return - 1 ; } for ( int i = 0 ; i < vct . size ( ) ; i ++ ) { if ( target . equals ( vct . elementAt ( i ) . value ) ) { return i ; } } return - 1 ; }
helper function to search for the given target string in a given vector in which the elements ' value may hopefully is equal to the target . if such elements are found the first index is returned , otherwise - 1
