Hey ...i want to use the arraylist to sort the item based on the item frequency ..how i do that..?
for example,
item:frequency
1: 7
2: 8
3: 4
4: 7
5: 1
my expected output is
item: frequency
2: 8
1: 7
4: 7
3: 4
5: 1
here is my coding
IDictionaryEnumerator enumerator2 = sItem.GetEnumerator();
ArrayList myArrayList = new ArrayList();
while(enumerator2.MoveNext())
{
show += enumerator2.Key.ToString() + ":" + enumerator2.Value.ToString()+"\n";
myArrayList.Add(show);
}
//MessageBox.Show(show.ToString());
myArrayList.Sort();
myArrayList.Reverse();
foreach(String rec in myArrayList)
{
MessageBox.Show(rec);
}
Hope someone can help me..thanks ya..