Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.16 KB

README.md

File metadata and controls

28 lines (16 loc) · 1.16 KB

Problem Set: Sorting Algorithms

Directions

Respond to short response questions in clear, concise sentences directly within this file. Use markdown to ensure that your answers are formatted correctly.

Complete code challenges in exercises.js.

Use Test Driven Development to guide you. Run npm install to download dependencies. Run npm test to run tests locally. Ensure all tests are passing before submitting this problem set.

Short Response Questions

  1. There are four sorting algorithms listed below. For each one, please provide:

    • A detailed explanation of how the algorithm works
    • The space and time complexity in Big O notation
    • Some cases when you might prefer or not prefer this algorithm over others (i.e. "This algorithm performs well if the list is already nearly sorted")

Insertion Sort:

Bubble Sort:

Merge Sort:

Quick Sort:

Coding Exercises

  1. In the exercises.js file, implement each of the sorting algorithms above without using JavaScript's built-in Array.prototype.sort() method. Each of the functions has been stubbed out for you, but you are welcome to create your own helper functions if needed.