Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.
Given a binary tree, find its maximum depth.
Level Order Traversal
Postorder Traversal
Inorder Traversal
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 all keys gr...
Preorder Traversal
Given a binary tree, find the length of the longest consecutive sequence path.
Given a binary tree, return all root-to-leaf paths.
Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.
Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value.
Flatten a binary tree to a fake “linked list” in pre-order traversal.
Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target.
For the given binary tree, return a deep copy of it.
Given a binary tree, design an algorithm which creates a linked list of all the nodes at each depth.
Given a number, insert a 5 at any position of the number to make the number after insertion the largest
Given a binary tree, return the postorder traversal of its nodes’ values. (Iteratively)
Given a sorted (increasing order) array, Convert it to create a binary search tree with minimal height.
Invert a binary tree. Left and right subtrees exchange.
Given a binary tree, find its minimum depth.
Given an n-ary tree, return the preorder traversal of its nodes’ values.
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.
Find the sum of all left leaves in a given binary tree.
Given a binary tree, return the tilt of the whole tree.
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s.
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.
Construct the maximum tree by the given array and return the root node of this tree.
Output the second minimum value in the set made of all the nodes’ value in the whole tree.
Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree.
Return this tree where every subtree (of the given tree) not containing a 1 has been removed.
Question
Question
Question
Question
Question
Reverse a singly linked list.
Add the two numbers and return it as a linked list. Question
Return indices of the two numbers such that they add up to a specific target. Question
Rob the most amount of money.
Rob the most amount of money.
Rob the most amount of money.
Row_Column_Swap_Template
How To Get Top N Diff Between Rank, Dense_Rank, and Row_Number