Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ramonbecker/sortingalgorithms

Project was developed in the implementation of bubble, selection and insertion sort algorithms with double linked list for the data structure discipline.
https://github.com/ramonbecker/sortingalgorithms

Last synced: 3 days ago
JSON representation

Project was developed in the implementation of bubble, selection and insertion sort algorithms with double linked list for the data structure discipline.

Awesome Lists containing this project

README

        

# Sorting algorithms
> Project was developed in the implementation of bubble, selection and insertion sort algorithms with a low level doubly linked list.
>
## :information_source: Information

Sorting algorithms are algorithms that place the elements of a given sequence in a certain order. In other words, it performs its full or partial ordering. The purpose of sorting is to facilitate the retrieval of data from a list.

The implemented algorithms were:
- Bubble Sort
- Insertion Sort
- Selection Sort

Bubble sort is the simplest algorithm, but the least efficient. In this algorithm each element of position i will be compared with the element of position i + 1, that is, an element of position 2 will be compared with the element of position 3. If the element of position 2 is greater than that of position 3, they they change places and so on. Because of this form of execution, the vector will have to be traversed as many times as necessary, making the algorithm inefficient for very large lists.

![algoritmos-bubble-sort](https://user-images.githubusercontent.com/44611131/114635280-c5a8c200-9c9a-11eb-9a28-93ee863f8755.gif)

Insertion sort is a simple and efficient algorithm when applied to small lists. In this algorithm, the list is scrolled from left to right, as it progresses, leaving the leftmost elements in order.

The algorithm works in the same way that people use to order cards in a card game like poker.

![algoritmos-insertion-sort](https://user-images.githubusercontent.com/44611131/114635475-2fc16700-9c9b-11eb-855e-e8d18cbf92d2.gif)

Selection Sort is based on always passing the lowest value of the vector to the first position (or the highest depending on the order required), then the second lowest value to the second position and so on, up to the last two elements.

In this sorting algorithm a number is chosen from the first, this chosen number is compared with the numbers from its right, when a smaller number is found, the chosen number occupies the position of the lowest number found. This number found will be the next number chosen, if no number less than this chosen is found, it is placed in the position of the first number chosen, and the next number to its right will be the one chosen to make the comparisons. This process is repeated until the list is sorted.

![algoritmos-selection-sort](https://user-images.githubusercontent.com/44611131/114635629-7dd66a80-9c9b-11eb-9733-319a82d1cc24.gif)

## ⚠️ Prerequisite
[![Java Badge](https://img.shields.io/badge/Java-ED8B00?style=for-the-badge&logo=java&logoColor=white)](https://www.oracle.com/br/java/technologies/javase-downloads.html) >= 11

## :rocket: Installation

![](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)

```sh
git clone https://github.com/RamonBecker/SortingAlgorithms.git
```

![](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)

```sh
git clone https://github.com/RamonBecker/SortingAlgorithms.git
or install github https://desktop.github.com/

```

## :zap: Technologies

- Java

## :memo: Developed features

- [x] Creation of 1 thousand, 10 thousand, 100 thousand elements
- [x] Ordering elements
- [x] Simple report generation for each sorting algorithm developed

## :technologist: Author

By Ramon Becker 👋🏽 Get in touch!

[github](https://github.com/RamonBecker) [linkedin](https://www.linkedin.com/in/https://www.linkedin.com/in/ramon-becker-da-silva-96b81b141//)
![Gmail Badge](https://img.shields.io/badge/[email protected]?style=flat-square&logo=Gmail&logoColor=white&link=mailto:[email protected])