diff --git a/06. Sorting/Insertion Sort using cpp b/06. Sorting/Insertion Sort using cpp new file mode 100644 index 0000000..6201eec --- /dev/null +++ b/06. Sorting/Insertion Sort using cpp @@ -0,0 +1,36 @@ +#include +using namespace std; +int main () +{ + int myarray[5] = { 12,4,3,1,15}; + cout<<"\nInput list is \n"; + for(int i=0;i<5;i++) + { + cout <=0 && temp <= myarray[j]) + { + myarray[j+1] = myarray[j]; + j = j-1; + } + myarray[j+1] = temp; + } +cout<<"\nSorted list is \n"; +for(int i=0;i<5;i++) + { + cout <