Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement