Tag: c++
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 …
Given a binary tree root, return whether for every node in the tree other than leaves, its value is equal to the sum of its left child’s value and …
Given a single linked list node, representing a binary number with most significant digits first, return it as an integer. Example 1 Input node = 1 → 0 → …