Skip to content

Instantly share code, notes, and snippets.

@Duta
Created February 20, 2014 17:57
Show Gist options
  • Save Duta/9119588 to your computer and use it in GitHub Desktop.
Save Duta/9119588 to your computer and use it in GitHub Desktop.
public Bst delete(int e) {
return e == root ? left.isEmpty() ? right : right.isEmpty() ? left : new Fork(left.largest(), left.deleteLargest(), right) : e < root ? new Fork(root, left.delete(e), right) : new Fork(root, left, right.delete(e));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment