[C#] C#字符串快速排序类 →→→→→进入此内容的聊天室

来自 , 2020-06-20, 写在 C#, 查看 161 次.
URL http://www.code666.cn/view/e0640c93
  1. using System;
  2. using System.Collections.Generic;
  3. using Sorting.CSharpStringSort;
  4.  
  5. namespace SortTests.Sorting
  6. {
  7.   public class sfList : List<string>
  8.   {
  9.     public sfList() : base() { }
  10.  
  11.     public sfList(int size) : base(size) { }
  12.  
  13.     public sfList(IEnumerable<String> aArray) : base(aArray) { }
  14.  
  15.     public new void Sort()
  16.     {
  17.       //StringSort.Sort(this);
  18.       string[] a = this.ToArray();
  19.       this.Clear();
  20.       //sort array and refill contents of this (faster than directly sorting List)
  21.       StringSort.Sort(ref a);
  22.       this.AddRange(a);
  23.     }
  24.   }
  25. }
  26.  
  27.  
  28. //调用:
  29. public static void Sort(ref string[] inout)
  30. {
  31.     InPlaceSort(inout, 0, 0, inout.Length);
  32. }
  33. //csharp/2003

回复 "C#字符串快速排序类"

这儿你可以回复上面这条便签

captcha