Pergunta de entrevista da empresa X

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

Respostas da entrevista

Sigiloso

19 de jul. de 2011

8 bits = 1 char?

9

Sigiloso

13 de abr. de 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

Sigiloso

9 de abr. de 2011

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