












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













public class Student { private String name; private int age; public Student(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public int getAge() { return age; } @Override public String toString() { return "name=" + this.getName()+" age="+this.getAge(); } } How can you compare students by name in ascending order? How can you compare students by age in descending order?
Binary Search Trees A binary tree is a binary search tree iff
BST ADT
Locating a Value
protected BinaryTree
Using locate to add a node Case Two: locate returns pointer to node with same value
Using locate to add a node Case Two: locate returns pointer to node with same value
protected BinaryTree
Removing nodes โ Node is a leaf r emove(52)
Removing nodes โ only one child remove(70)
Removing nodes
Complexity