All pastes #1663034 Raw Edit

Unnamed

public java v1 · immutable
#1663034 ·published 2009-11-09 06:27 UTC
rendered paste body
public Comparable findSmallest ( BinaryTreeNode T) {       //Nothing in the tree    if (T.getData() == null){        return null;    }    //Only one node    if (T.getLeft() == null && T.getRight() == null){        return T.getData();    }    //if the left node is smaller, run the procedure on the new node, return current     node once this doesn't hold    if (T.getLeft() < T.getData()) {        return findSmallest(T.getLeft());    }    return T.getData();}