Created
February 4, 2015 06:21
-
-
Save nuttt/67003b5e7c7eba133bd7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| build a binary tree class (with no repeat element in tree) | |
| with following APIs | |
| - new() | |
| - addnode(int a) | |
| --- return true if a is not already in binary tree | |
| --- otherwise return false | |
| - removenode(int a) | |
| --- return true if a is removed in binary tree | |
| --- return false if otherwise | |
| - depth(int a) | |
| --- return integer repesents depth of a in binary tree | |
| --- return null if a is not in binary tree | |
| - isInBinaryTree(int a) | |
| - preorder() | |
| --- return array of integer representing preorder traversal of tree | |
| - inorder() | |
| - postorder() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment