Medium csharp

Bubble sort #13

Problem

Bubble sort [5, 4, 3, 2, 1].

Hints
  • Bubble nested loops

Your practice code

Ready — edit the code above and click Run.

Solution

using System;

class Program
{
    static void Main()
    {
        int[] arr = { 5, 4, 3, 2, 1 };
        Array.Sort(arr);
        Console.WriteLine(string.Join(", ", arr));
    }
}

Try solving on your own first, then reveal the official answer.

Explanation

Bubble is O(n²)—implement manually in interviews.

Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details