X Interview Question

Given a 8-bit string, determine how to find the most reoccuring character.

Interview Answers

Anonymous

Jul 19, 2011

8 bits = 1 char?

9

Anonymous

Apr 13, 2011

Two ways to approach this. Maintain a hash of characters (int array of 128 ascii characters) and then incremement the count. At the end run through the array to find the highest count instance. Second method. Sort the string and then count the repeated character instances. Maintain a highest counter while you count.

4

Anonymous

Apr 9, 2011

The question seems easy, but he went pretty indepth with my algorithm.