摘要:
Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array, find all the majority 阅读全文
摘要:
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
摘要:
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文