Git Product home page Git Product logo

typescript_sorting_algorithms's Introduction

Sorting Algorithms

This repository contains implementations of some sorting algorithms written in TypeScript.

It might not be a perfect implementation, but it should at least give you an idea of how a certain algorithm works.

You are free to use this as a package, as this repository will have more algorithms at some point.

Credits for a documentation should go to Wikipedia

How to use

Say use want to use sort implemented in a form of a class:

import { BubbleSort } from '../src/bubble_sort'

let foo = ['some', 'elements', ...]

foo = BubbleSort.sort(foo)

For a more functional way:

import { functionalQuickSort } from '../src/quick_sort'
let someArray: Array<number> = [1, 4, 5, 2, 6]
someArray = functionalQuickSort(input, comparator)

Notes

Many sorting algorithms are often available 'natively' in your language of choice. Unless there's a particular and valid reason for you to write your own implementation of a sorting algorithm I strongly recommend sticking to already available implementations.

Important note: Explicit return of the values in the implementations is done purposefully for those who are less familiar with JS/TS and its way of handling referenced values

Contributing

Pull requests are welcome. If you want to add new algorithms just add some simple tests and fairly understandable implementation for others to go through.

License

MIT

typescript_sorting_algorithms's People

Contributors

kubabialy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

devorein

typescript_sorting_algorithms's Issues

Version 0.0.1

Is your feature request related to a problem? Please describe.
In current form this package still provides close to no value and there's an idea to make it somewhat usable for others.

Describe the solution you'd like
Push for version 0.0.1 and publish it on the NPM. Both BubbleSort and QuickSort must work bi-directly, and must be fully usable in a 'functional' and the 'OOP' way.

Describe alternatives you've considered
Alternative would be to abandon functional way of using those algorithms for version 0.0.1 to get it done faster.

Additional context
N\A

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.