Hacktoberfest2021
Hacktoberfest2021 copied to clipboard
majority element
Problem statement: Given an array of n elements check whether it has a majority element or not
Three approaches are discussed in the solution viz.
- Brute Force O(n*n)
- Sorting O(n*logn)
- Boyer-Moore Vote algorithm O(n)