Tag: recursion
Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-node. If the node has …
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of …
Given a binary tree like this: 8 / \ 6 10 / \ / \ 5 7 9 11 Your task is to mirror it which becomes this: 8 …
Given a integer, convert it to its base 7 representation in string format. For example, 101 = (202)7 and -7 = (-10)7 Recursive Approach to Convert Integer to Base7 …
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 …