Tag Archive

Easy

Convert BST to Greater Tree

1 minute read

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...

Lowest Common Ancestor II

1 minute read

Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.

Same Tree

1 minute read

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.

Binary Tree Path Sum

1 minute read

Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target.

Clone Binary Tree

less than 1 minute read

For the given binary tree, return a deep copy of it.

Insert Five

1 minute read

Given a number, insert a 5 at any position of the number to make the number after insertion the largest

Invert Binary Tree

less than 1 minute read

Invert a binary tree. Left and right subtrees exchange.

Leaf-Similar Trees

1 minute read

Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence.

Binary Tree Tilt

1 minute read

Given a binary tree, return the tilt of the whole tree.

Subtree of Another Tree

2 minute read

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.

Maximum Binary Tree

1 minute read

Construct the maximum tree by the given array and return the root node of this tree.

Minimum Difference Between BST Nodes

1 minute read

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.

Binary Tree Pruning

1 minute read

Return this tree where every subtree (of the given tree) not containing a 1 has been removed.

Get Top N

less than 1 minute read

How To Get Top N Diff Between Rank, Dense_Rank, and Row_Number

Two Sum

1 minute read

Return indices of the two numbers such that they add up to a specific target. Question

Back to top ↑

Medium

Add Two Numbers

1 minute read

Add the two numbers and return it as a linked list. Question

Back to top ↑