Tag: algorithm
Given a binary tree, return the vertical order traversal of its nodes values. For each node at position (X, Y), its left and right children respectively will be at …
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. …
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list — …
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 …