Tag Archives: tree

Balanced Binary Tree


Implement a function to check if a tree is balanced. For the purposes of this question, a balanced tree is defined to be a tree such that no two leaf nodes differ in distance from the root by more than one. TreeNode.h TreeNode.m And some pseudo code:

https://xandercale.wordpress.com/2015/08/13/balanced-binary-tree/

Binary Search Tree from Array


Give a sorted array. Create a Binary Search Tree (BST). A BST is defined has having all left descendants <= n < all right descendants. I’m using the same TreeNode object defined in my last post. BinarySearchTree.h BinarySearchTree.m

https://xandercale.wordpress.com/2015/08/13/binary-search-tree-from-array/

Confirm Binary Search Tree


Given some Node, determine whether it is a Binary Search Tree (BST). As defined before, a BST is defined has having all left descendants <= n < all right descendants. By traversing a tree using In Order Traversal, we can check and see if the last element is less than or equal to the current […]

https://xandercale.wordpress.com/2015/08/13/confirm-binary-search-tree/