Category: algorithms
Given a binary tree root, count and return the number of nodes where its value is greater than or equal to the values of all of its descendants. For …
Given a list of integers nums, return the minimum cost of sorting the list in ascending or descending order. The cost is defined as the sum of differences between …
Given a Monotone Increasing Function f(x) and if y=f(x) is known, find the value of x. Find the x by Binary Search Algorithm Because function f(x) is monotone increasing …
Given a binary tree root, return the largest absolute difference between any node and its descendants. For example, given the following tree: 0 / \ 4 2 / \ …
Given a list of integers nums, sort the list in the following way: First number is the maximum Second number is the minimum Third number is the 2nd maximum …