Skip to content

Assignment 8 (trees 3)

yahya tawil edited this page Nov 27, 2021 · 3 revisions
  • Add to BST class shown in this session any traversal algorithm as a new method and call this new method in main to print the tree nodes.
  • Add to BST class shown in this session the delete algorithm as a new method. Delete a node and call then the print method using traversing algorithm to show that it was removed correctly.

Example:

    root = T.Insert(root,100);
    T.Insert(root,20);
    T.Insert(root,10);
    T.Insert(root,500);
    T.Insert(root,30);

    T.delete(100);

    T.print();