Find if a certain number occupied at least 1/4 of a sorted array | Hello World
given example {1, 1, 2, 4} return true {1, 1, 2, 3, 4, 5, 6, 7, 8} return true, {1, 2, 3, 4} return false
O(n) is simple, how about O(logn)? hint: binary search
Read full article from Find if a certain number occupied at least 1/4 of a sorted array | Hello World
No comments:
Post a Comment