Sorting Algorithms and Big O Analysis

This project, titled "0x1B. C - Sorting algorithms & Big O,". The primary goal of this project is to gain a deep understanding of various sorting algorithms and the Big O notation for analyzing algorithm time complexity. Project Overview

We will explore and implement several sorting algorithms in the C programming language. These sorting algorithms include Bubble Sort, Insertion Sort, Selection Sort, and Quick Sort. For each algorithm, we will provide a function that sorts an array of integers in ascending order.

In addition to implementing the sorting algorithms, we will analyze their time complexity using Big O notation. This analysis will help us understand how these algorithms perform in different scenarios.

Provided Resources

For this project, the following resources are provided:

print_array and print_list functions for printing arrays and linked lists, respectively.
A listint_t data structure for doubly linked lists.

Big O Analysis

Throughout the project, we will analyze the time complexity of the sorting algorithms in terms of Big O notation. We will provide these analyses for each algorithm, considering their best-case, average-case, and worst-case scenarios.

Testing

To test the sorting algorithms with large sets of random integers, you can use external resources like [Random.org]. Tasks

0. Bubble Sort

Implement the Bubble Sort algorithm for sorting an array of integers in ascending order.
Provide the Big O notations for the time complexity of Bubble Sort in the best case, average case, and worst case scenarios.

1. Insertion Sort

Implement the Insertion Sort algorithm for sorting a doubly linked list of integers in ascending order.
Provide the Big O notations for the time complexity of Insertion Sort in the best case, average case, and worst case scenarios.

2. Selection Sort

Implement the Selection Sort algorithm for sorting an array of integers in ascending order.
Provide the Big O notations for the time complexity of Selection Sort in the best case, average case, and worst case scenarios.

3. Quick Sort

Implement the Quick Sort algorithm for sorting an array of integers in ascending order, using the Lomuto partition scheme.
Provide the Big O notations for the time complexity of Quick Sort in the best case, average case, and worst case scenarios.

By Thabiso Rantsho