Author: ACMer
Write a function to check whether a given 32-bit signed integer is a power of 4. Example: If num = 64, return true. and if num = 9, return …
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most …
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: Almost every tree …
Given a binary tree, return its inorder traversal of its nodes’ values. For example: The binary tree, 1 \ 2 / 3 should return the inorder = . Recursion …
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. …