Skip to content

This is a program that demonstrates two sorting algorithms, Bubble Sort and Insertion Sort, by generating a random array of 10,000 integers and sorting it with both algorithms. The program then prints the sorted arrays.

Notifications You must be signed in to change notification settings

FilipRokita/sortingAlgorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

sortingAlgorithms

sortingAlgorithms is a Python program that demonstrates two sorting algorithms: bubble sort and insertion sort.

How it works

The program generates a list of 10,000 random integers between 0 and 9. It then applies bubble sort and insertion sort to the list and prints the sorted results.

Bubble Sort

Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

Insertion Sort

Insertion sort is another simple sorting algorithm that builds the final sorted array one item at a time. It iterates through the input list, removes one item at a time, finds the location it belongs within the sorted list, and inserts it there. It repeats until no input elements remain.

Installation

To run the program, simply download the code and run it using a Python interpreter. This program does not require any external libraries or dependencies.

Usage

Once the program has been executed, the sorted results will be printed to the console.

About

This is a program that demonstrates two sorting algorithms, Bubble Sort and Insertion Sort, by generating a random array of 10,000 integers and sorting it with both algorithms. The program then prints the sorted arrays.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages