<< split from http://cboard.cprogramming.com/c-pro...-%2A%2Att.html >>
To analysing a string, then finding the char whose counts of appearing in string is max.
how to solve this question?

for example:
Code:
char *string = "ab---ebbbe";
the appearing counts of char 'b'  is max. It is 3.
I now think two method.
one is :
Code:
sort(string);
statisticalCountofChar(string);
the other is
Code:
char *individualofChar;
for ( string )
{
      for ( *individualofChar )
      {
            caculateCountofChar();
      }
}
is there even more better method to solve this question?
how to solve this question using HASHING TABLE? how to design hashing function ?