Git Product home page Git Product logo

42-sorting-algorithms's Introduction

cf 42: Sorting Algorithms

Submission Instructions

  • Work in a fork of this repository
  • Work in a branch on your fork
  • Write all of your code in a directory named lab- + <your name> e.g. lab-susan
  • Submit a pull request to this repository
  • Submit a link to your pull request on canvas
  • Submit a question, observation, and how long you spent on canvas

Requirements

Configuration

Your lab directory must include

  • README.md -- with a documention about your lab
  • .eslintrc.json -- with the class .eslintrc.json file
  • .gitignore -- with a robust gitignore
  • .eslintignore -- with the class .eslintignore
  • package.json -- with all dependencies and dev-dependencies
  • src/ -- containing the frontend code

Feature Tasks

Pick one of the following feature tasks:

1 - Implement a stable version of Quick Sort

This is a fairly common interview question

The Quick Sort implementation covered in class was not stable. Research and implement a stable version of the algorithm.

2 - Mutate Merge Sort's input array

The Merge Sort implementation covered in class didn't mutate the input array (it creates an output array). Implement a version of Merge Sort that mutates the input array.

3 - Implement Radix Sort

This is a fairly common interview question

Research and implement Radix Sort.

This is an interesting problem since Radix Sort uses a different logic than the 'Divide and Conquer' approach covered in class

4 - Implement Heap Sort

Research and implement Heap Sort.

The implementation can be either stable or unstable

5 - Implement a Quick Sort/Insertion Sort Hybrid

Modify the Quick Sort implementation to use Insertion Sort if the length of the sorting set is less than 10 elements.

6 - Implement Quick Sort with 3-way partition

The Quick Sort implementation covered in class divided an array into two areas

  • Elements smaller than the pivot
  • Elements greater than or equal to the pivot

Research and implement a version of Quick Sort that divides the array into three areas:

  • Elements smaller than the pivot
  • Elements equal to the pivot
  • Elements greater than the pivot

Testing

  • Write a test function that generates an array of N random integers
  • Write a test function that asserts an array is sorted (based on your sorting implementation)
  • Test each sort against an empty array, single-element array, small array, medium array and a large array (1,000 - 10,000 items).

Stretch Goals

Implement the remaining feature tasks

Documentation

Write a description of the project in your README.md

42-sorting-algorithms's People

Contributors

izzybaer avatar

Watchers

James Cloos avatar Hector N 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.