Пример #1
0
 public void display()
 {
     if (!(root == null))
     {
         root.display(root);
     }
 }
Пример #2
0
 //Display node
 public void display()
 {
     if (!isEmpty())
     {
         rootNode.display(rootNode);
     }
 }
        public Node search(Node newNode, int data)
        {
            if (newNode == null)
            {
                return(null);
            }


            if (newNode.data == data)
            {
                newNode.display(newNode);

                return(newNode);
            }
            if (data < newNode.data)
            {
                return(search(newNode.leftBranch, data));
            }

            else
            {
                return(search(newNode.rightBranch, data));
            }
        }