Author: ACMer
Given a list of integers nums, return whether it represents a max heap. That is, for every i we have that: nums ≥ nums if 2*i + 1 is …
Teaching Kids Programming: Videos on Data Structures and Algorithms The factorial function f(n) implemented in Python using Recursion: def f(n): if n == 1: return 1 return n * …
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 …