You are viewing a single comment's thread. Return to all comments →
C#
public static void insertionSort2(int n, List<int> arr) { for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) { if (arr[j] > arr[i]) { var temp = arr[j]; arr[j] = arr[i]; arr[i] = temp; } } Console.WriteLine(string.Join(" ", arr)); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 2
You are viewing a single comment's thread. Return to all comments →
C#