Tag: tree algorithms
Given a binary tree, compute the average values for the nodes on each level and return them in the form of an array. For example: Input: 3 / \ …
Given a binary tree, convert it to a string that consist of parenthesis and interests in the pre-order traversal. The empty brackets () for left sub trees can be …
Given an array of sorted integers, let’s arrange it to a highly balanced binary search tree (BST). The left nodes of a binary search tree are smaller than the …