https://github.com/filiprokita/sortingalgorithms
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.
https://github.com/filiprokita/sortingalgorithms
algorithms bubble bubble-srot insertion insertion-sort python sort sorting
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/filiprokita/sortingalgorithms
- Owner: FilipRokita
- Created: 2021-12-04T23:36:34.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-04T12:46:30.000Z (over 2 years ago)
- Last Synced: 2025-03-24T21:33:30.844Z (7 months ago)
- Topics: algorithms, bubble, bubble-srot, insertion, insertion-sort, python, sort, sorting
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.