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....

VulpesPosted Oct 26, 2012, 4:02 PM
Turkalp KucurPosted Oct 27, 2012, 5:06 AM
Thank you!
Santhosh Kumar JayaramanPosted Oct 27, 2012, 4:59 AM
So you need to have generic return statement at the end of program after if block or create else block and return something.
Turkalp KucurPosted Oct 27, 2012, 4:33 AM
I wrote a function:
it says, "not all part of the code returns a value....
what can I do...
V S N Raju KanumuriPosted Oct 26, 2012, 1:39 PM
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"); }
Santhosh Kumar JayaramanPosted Oct 26, 2012, 1:31 PM