Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BST {
- constructor() {
- this.root = null
- }
- postOrder(root) {
- if (!root) {
- return 'Tree is empty'
- } else {
- this.postOrder(root.left)
- this.postOrder(root.right)
- console.log(root.value)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement