What is insertion sorting?
Answer / Md Irshadur Rahman
Insertion Sort is a simple sorting algorithm that sorts an array by repeatedly taking one element from the unsorted part of the array and inserting it into the correct position in the already sorted part. It is most efficient when the input is nearly sorted.nnExample:nvoid insertionSort(int arr[], int n) {n for (int i = 1; i < n; i++) {n int key = arr[i];n int j = i-1;n while (j >= 0 && arr[j] > key) {n arr[j+1] = arr[j];n j--;n }n arr[j+1] = key;n }n}
| Is This Answer Correct ? | 0 Yes | 0 No |
What do you mean by abstraction. Explain your answer?
What is binary object model?
Can a constructor return a value?
Explain the difference between c++ and java.
What is pure virtual function? Or what is abstract class?
What are static member functions?
When is the destructor called?
What is a sequence in c++?
Explain the virtual inheritance in c++.
What is the exit function in c++?
What do you mean by abstraction in C++?
Why do we use constructor?