Question DSA-ARR-0047
MediumWhich algorithm finds the majority element (appearing more than n/2 times) in O(n) time and O(1) space?
- A.
Binary search
- B.
Boyer–Moore voting
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Arrays question
Which algorithm finds the majority element (appearing more than n/2 times) in O(n) time and O(1) space?
Binary search
Boyer–Moore voting
Sign up free to see the answer and a step-by-step explanation.
Merge sort
Kadane's algorithm