Category: c / c++
Given the root node of a binary search tree (BST) and a value to be inserted into the tree, insert the value into the BST. Return the root node …
A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univalued. A binary tree …
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 search tree, write a function kthSmallest to find the kth smallest element in it. You may assume k is always valid, 1 ≤ k ≤ BST’s …
A kangaroo is at one side of the river. There are N springs in the river, each is separated 1 meter, like this: K| . . . . . …