You are on page 1of 6

Insertion sort

Group 3
Insertion Sort
Insertion Sort is a simple sorting • It starts with the second element
algorithm that builds the final of the array and compares it with
sorted array one item at a time. the elements before it.
It works by iteratively consuming
elements from an unsorted part • It repeatedly shifts larger
of the array and inserting them elements to the right until it finds
into their correct position in the the correct position for the
sorted part of the array. current element.

• It inserts the current element into


its correct position in the sorted
part of the array.
Insertion sort
Algorithm
Insertion sort is a sorting
algorithm that builds a final
sorted array (sometimes called a
list) one element at a time. While
sorting is a simple concept, it is a
basic principle used in complex
computer programs such as file
search, data compression, and
path finding.
Uses/Practical Application of
Insertion Sort
Small Datasets: Online Algorithms:

Preprocessing Step Partially Sorted Data:

Nearly Sorted Arrays


Big O Notation
• Big O notation describes the limiting behavior of
Big O notation is a mathematical an algorithm as the size of the input approaches
notation used in computer science to infinity.
describe the complexity or
• It focuses on the dominant term or the term with
performance of algorithms. It
the highest impact on the algorithm's
represents the upper bound or performance.
worst-case scenario of the time or
• It disregards constant factors and lower-order
space required by an algorithm to
terms, as they become insignificant for large
solve a problem, as the size of the
inputs.
input grows to infinity.
• Big O notation is commonly used to analyze and
compare the efficiency of different algorithms,
helping programmers choose the most suitable
algorithm for their problem based on its
scalability and performance characteristics.

You might also like