Skip to content

Instantly share code, notes, and snippets.

Created January 3, 2013 14:58
Show Gist options
  • Save anonymous/4444042 to your computer and use it in GitHub Desktop.
Save anonymous/4444042 to your computer and use it in GitHub Desktop.
programming test for visualdna
class PrintBST
{
public static void print(BST bst)
{
BST left = bst.getLeftChild();
BST right = bst.getRightChild();
if(left != null)
{
PrintBST.print(left);
}
if(right != null)
{
PrintBST.print(right);
}
System.out.println(bst.getValue());
}
public static void main(String[] args)
{
BST bst = BST.getSampleInstance();
PrintBST.print(bst);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment