Basic Sorting Programs
Task: Insertion Sort Time Complexity O(n²) For Best Case - O(n) Code: #include <iostream> using namespace std ; int main () { int a [] = { 16 , 190 , 11 , 15 , 10 , 12 , 14 }; int n = 7 ; for ( int i = 1 ; i < n ; i ++) { int temp = a [ i ]; int j = i - 1 ; while (( temp < a [ j ]) && ( j >= 0 )) { a [ j + 1 ] = a [ j ]; //moves element forward...