I have an arraylist les say
string[] list = new list{4,5,6,6,7,8,6,7,3,8,7,9,7 };
I want to identify the three times repeated values in arraylist list.
e.g. program will output that:
The value 6 is repeated three times..
The value 7 is repeated 4 times..
note: I don't need the whole program.. I just don't have any idea how a value is checked whether if it repeated itself three or more times....
help please....


VulpesRank #55 · 29.2K reputationPosted Oct 26, 2012, 12:02 PM EDT
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Oct 26, 2012, 9:31 AM EDT
V S N Raju KanumuriRank #8,839 · 215 reputationPosted Oct 26, 2012, 9:39 AM EDT
foreach (int item in list)
{
Console.Write(item.ToString() + "is repeated ");
int count = 0;
for (int i = 0; i < list.Length; ++i)
{
if (list[i] == item) ++count;
}
Console.WriteLine(count.ToString()+" times"); }
Turkalp Kucur47 reputationPosted Oct 27, 2012, 12:33 AM EDT
I wrote a function:
it says, "not all part of the code returns a value....
what can I do...
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Oct 27, 2012, 12:59 AM EDT
So you need to have generic return statement at the end of program after if block or create else block and return something.
Turkalp Kucur47 reputationPosted Oct 27, 2012, 1:06 AM EDT
Thank you!