@@ -0,0 +1,1078 @@
+%22%22%22Insertion Sort Algorithm.%0A%0AThe Insertion Sort is a sort of order n*n.%0A%0AIs a sorting algorithm which moves elements one at a time into the correct%0Aposition. The algorithm consists of inserting one element at a time into the%0Apreviously sorted part of the array, moving higher ranked elements up as%0Anecessary.%0A%0ATo start off, the first (or smallest, or any arbitrary) element of the unsorted%0Aarray is considered to be the sorted part.%0A%22%22%22%0A%0A%0Adef insertionsort(unsorted_list):%0A    %22%22%22Sorts the input list using the quick sort algorithm.%0A%0A    %3E%3E%3E unsorted_list = %5B4, 5, 1, 6, 3%5D%0A    %3E%3E%3E insertionsort(unsorted_list)%0A    %5B1, 3, 4, 5, 6%5D%0A    %22%22%22%0A%0A    # Make a copy of the list%0A    sorted_list = unsorted_list%0A%0A    # Loop through the array%0A    for i in range(1, len(sorted_list)):%0A        current_value = sorted_list%5Bi%5D%0A        position = i%0A%0A        while position %3E 0 and sorted_list%5Bposition - 1%5D %3E current_value:%0A            sorted_list%5Bposition%5D = sorted_list%5Bposition - 1%5D%0A            position = position - 1%0A%0A        sorted_list%5Bposition%5D = current_value%0A%0A    return sorted_list%0A

Add Insertion Sort