This program was based on sorting algorithms and Big O notation.
A sorting algorithm is a defined procedure for arranging a set of
data elements in a particular order. This order can be ascending
(smallest to largest), descending (largest to smallest), or based
on custom criteria defined for the specific data type. Sorting
algorithms are fundamental building blocks in various computing tasks,
from organizing user interfaces to processing large datasets in machine
learning and scientific computing.
Here are some key characteristics of sorting algorithms:
- Time complexity.
- Space complexity.
- Stability.
- Adaptability.
Big O notation is a mathematical tool used to describe the asymptotic
upper bound of the complexity of an algorithm with respect to its input size.
In simpler terms, it tells you how much the running time or resource usage of
an algorithm grows as the input size increases indefinitely.
Here are some key aspects of Big O notation:
- Upper bound.
- Asymptotic behavior.
- Common notations:
- O(1): Constant time, the algorithm's time doesn't depend on
the input size. - O(n): Linear time, the time grows proportionally to the input size.
- O(n log n): Log-linear time, the time grows slightly slower than
the input size (logarithmically). - O(n^2): Quadratic time, the time grows much faster than the
input size (squared). - O(log n): Logarithmic time, the time decreases as the input size increases.
- O(1): Constant time, the algorithm's time doesn't depend on
Understanding Big O notation is crucial for analyzing the efficiency of algorithms
and choosing the most suitable one for a specific task, especially when dealing with
large datasets. It helps make informed decisions about what algorithms to use in
various situations and avoid wasting resources on inefficient ones.
In this task, we implement a function that sorts an array of
integers using the bubble sort algorithm.
This task implements a function that sorts a doubly linked list
of integers using the insertion sort algorithm.
Here, a function is implemeted that sorts in ascending order,
an array of integers, using the selection sort algorithm.
Lke task 2, task 3 does the same thing but using the quick sort
algorithm. To implement this function, use was made of the
Lomuto Partion Scheme.