What's the most elegant way to bubble-sort in C#?

后端 未结 10 1879
旧巷少年郎
旧巷少年郎 2020-12-06 03:33

Can this be cleaned up?

using System;  
class AscendingBubbleSort 
{     
    public static void Main()
    {
        int i = 0,j = 0,t = 0;
        int []c=         


        
10条回答
  •  星月不相逢
    2020-12-06 03:48

    I think your algorithm in ok, but I would put the sort functionality in a seperate class and method.

提交回复
热议问题