Created
January 3, 2013 14:58
-
-
Save anonymous/4444042 to your computer and use it in GitHub Desktop.
programming test for visualdna
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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