Skip to content

Instantly share code, notes, and snippets.

@paratechnical
Created June 4, 2012 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paratechnical/2869203 to your computer and use it in GitHub Desktop.
Save paratechnical/2869203 to your computer and use it in GitHub Desktop.
var tree = new Tree();
tree.Insert("romane");
tree.Insert("romanus");
tree.Insert("romulus");
tree.Insert("rubens");
tree.Insert("ruber");
tree.Insert("rubicon");
tree.Insert("rubicundus");
Console.WriteLine("predecessor of the word \"romanes\":" + tree.FindPredecessor("romanes"));
Console.WriteLine("successor of the word \"rom\":" + tree.FindSuccessor("rom"));
Console.WriteLine(tree.Lookup("romulus") ? "there" : "not there");
tree.Delete("romanus");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment