GithubHelp home page GithubHelp logo

akshaybahadur21 / sort Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 18.0 208 KB

Implementation of Bubble Sort, Selection Sort, Insertion Sort, Merge Sort & Quick Sort for humans 〽️

License: MIT License

Java 88.10% C++ 11.90%
sorting-algorithms sort insertion-sort bubble-sort selection-sort merge-sort quick-sort algorithms sorting-algorithm

sort's Introduction

Sorting Algorithms 〽️

This code helps you to understand the different Sorting algorithms. The sorting algorithms depicted in this code are:

  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. Quick Sort
  5. Merge Sort
  6. Heap Sort

Code Requirements 🦄

The example code is in Java (version 1.8 or higher will work).

Description ➿

A sorting algorithm is an algorithm made up of a series of instructions that takes an array as input, performs specified operations on the array, sometimes called a list, and outputs a sorted array. Efficient sorting is important for optimizing the use of other algorithms (such as search and merge algorithms) which require input data to be in sorted lists; it is also often useful for canonicalizing data and for producing human-readable output. More formally, the output must satisfy two conditions:

The output is in nondecreasing order.
The output is a permutation (reordering) of the input.
switch(ch)
		{
			case 1:
				BubbleSort(a,n);
				break;
			case 2:
				SelectionSort(a,n);
				break;
			case 3:
				InsertionSort(a,n);
				break;
			case 4:
				int start=0;
				int end=n-1;
				QuickSort(a,start,end);
				print(a,n);
				break;
			case 5:
				MergeSort(a,n);
				print(a,n);	
				break;
		}

You can select any algorithm from the list and then enter an array which would get sorted through the selected algorithm.

Results 📊

Execution 🐉

To compile the code, simply run the javac Sort.java. To run the code, type java Sort

javac Sort.java
java Sort

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.