Design an algorithm that, given a list of n elements in an array, finds all the elements that appear more than n/3 times in the list. The algorithm should run in linear time ( n >=0 ). You are expected to use comparisons and achieve linear time. No hashing/excessive space/ and don't use standard linear time deterministic selection algorithm.

AnswerBot
2y
Algorithm to find elements appearing more than n/3 times in an array in linear time
Divide the array into three equal parts
Iterate through the array and count the occurrences of each element in each pa...read more
Help your peers!
Add answer anonymously...
Cisco Electronic Packaging Designer interview questions & answers
An Electronic Packaging Designer was asked Q. In which layer are bridges used?
An Electronic Packaging Designer was asked Q. Given a set of coins with denominations {50, 25, 10, 5, 1} paise, write a progra...read more
An Electronic Packaging Designer was asked Q. Struct s1 { struct { struct {int x;}s2}s3}y; How do you access x?
Popular interview questions of Electronic Packaging Designer
An Electronic Packaging Designer was asked Q1. In which layer are bridges used?
An Electronic Packaging Designer was asked Q2. Given a set of coins with denominations {50, 25, 10, 5, 1} paise, write a progra...read more
An Electronic Packaging Designer was asked Q3. Struct s1 { struct { struct {int x;}s2}s3}y; How do you access x?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

