插入排序算法请参考:http://baike.baidu.com/view/1193395.htm?func=retitle int[] insert_sort(int[] target) { //At least two numbers to comparing if (target.Length < 2) return target; ArrayList list = new ArrayList(1); list.Add(target[0]); int compareCount; for (int i = 1; i < target.Length; i++) { compareCount = 0; for (int j = 0; j < list.Count; j++) if (target[i] > (Int32)list[j]) compareCount++; else break; //insert into the right position list.Insert(compareCount,target[i]); } for (int i = 0; i < list.Count; i++) target[i] = (Int32)list[i]; return target; } 这个很简单的。等到快速排序贴出后,我会举例比较一下他们的性能。