Answers for "bubble sort recursive c#"

C#
0

bubble sort recursive c#

public int[] Sort(int[] sortArray)
    {
        for (int i = 0; i < sortArray.Length - 1; i++)
        {
            for (int j = sortArray.Length - 1; j > i; j--)
            {
                if (sortArray[j] < sortArray[j - 1])
                {
                    int x = sortArray[j];
                    sortArray[j] = sortArray[j - 1];
                    sortArray[j - 1] = x;

                }
            }
        }
        return sortArray;
    }
Posted by: Guest on July-16-2021

C# Answers by Framework

Browse Popular Code Answers by Language