Code Monkey home page Code Monkey logo

30-sorting-algorithms-research's Introduction

Lab 30: Basic Sorting

======

About this project:

This project was an assignment from Code Fellow's 401 - Advanced Javascript. The assignment was to research and implement three sort algorithms:

Implementation:

The sorting algorithms needs to be implemented to take an airty of one array and the output is the array sorted in place and returned at the end of the method.

Modules

  • bubble-sort.js

    • This module exports a method that implements a bubble sort algorithm in javascript. It has an airty of one input which is an array. It's output is the array sorted in place and returned.
    • Time: O(n^2) where n = length of the array (if the array is already sorted O(n))
    • Space: O(1)
  • insertion-sort.js

    • This module exports a method that implements a insertion sort algorithm in javascript. It has an airty of one input which is an array. It's output is the array sorted in place and returned.
    • Time: O(n^2) where n = length of the array (if the array is already sorted O(n))
    • Space: O(1)
  • selection-sort.js

    • This module exports a method that implements a selection sort algorithm in javascript. It has an airty of one input which is an array. It's output is the array sorted in place and returned.
    • Time: O(n^2) where n = length of the array
    • Space: O(1)
  • swap.js

    • This module exports a method that implements a memo swap using Javascript ES6 destructuring. This module is exported to the bubble-sort.js and is used as a helper function. The method takes in three parameters, an array and placeholders for two elements in the array that can be swapped based on a comparison in the sorting methods above.

Test Suite

  • sorting-algo.test.js
    • The test suite contains three simple tests for each sorting module. The test compares an unsorted array input into each method and expects the returned value to be a sorted array.

References

30-sorting-algorithms-research's People

Contributors

vibecastor avatar vladimirsan avatar

Watchers

James Cloos avatar

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.