public void insert(int newdata){
    if(root == null){
      root = new BSTnode(newdata);
    }
    else{
      BSTnode backPointer , Pointer;
      backPointer = Pointer = root;
      while(Pointer != null){
        backPointer = Pointer;
        if(newdata < Pointer.data){
          Pointer = Pointer.left;
        }
        else{
          Pointer = Pointer.right;
        }
      }
      if(newdata <backPointer.data){
        backPointer.left = new BSTnode(newdata);
      }
      else{
        backPointer.right = new BSTnode(newdata);
      }
    }
  }