Medium csharp

Insertion sort #51

Problem

Insertion sort [7, 6, 5, 4, 3, 2, 1].

Hints
  • Insertion nested loops

Your practice code

Ready — edit the code above and click Run.

Solution

using System;

class Program
{
    static void Main()
    {
        int[] arr = { 7, 6, 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

Insertion 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