Coder Social home page Coder Social logo

sorting's Introduction

Sorting Algorithms

In this two day project, you will be implementing many different solutions to the same problem: sort a list of integers in ascending order. You will also be using your newfound knowledge of complexity analysis to evaluate each implementation for efficiency.

No Googling for Code

For the sorting module, it's OK to Google for things like this:

  • Pseudocode
  • Descriptions of algorithms
  • Videos that show how the algorithm works

But you should NOT search for:

  • Code

If you see code, avert your eyes and hit the back button!

This isn't for anti-cheating purposes. This is because if you copy code, you won't learn the most important part of this lesson! One of the things we want to practice here is to take a spec and turn it into code. You'll be expected to do this incessantly at work, and we want to practice it here. Yes, it's harder this way, but you don't get better by practicing easy stuff.

Your task is to take a simple problem (sort an list of ints) and a pre-defined plan (we give you an algorithm description) and turn that into code. These steps should sound familiar, as they are 1-3 of the Lambda Problem Solving Framework. Soon, you will be coming up with your own plans for more complex problems so don't cheat yourself out of valuable coding practice.

That being said, please still use the 20 minute rule ๐Ÿ™‚

Part 1

MVP Tasks

  • Open up the iterative_sorting directory
  • Read through the descriptions of the bubble_sort and selection_sort algorithms
  • Implement bubble_sort and selection_sort in iterative_sorting.py
  • Test your implementation by running test_iterative.py

Part 2

MVP Tasks

  • Open up the recursive_sorting directory
  • Read through the descriptions of the merge_sort algorithm
  • Implement merge_sort in recursive_sorting.py
  • Test your implementation by running test_recursive.py

Stretch Goals

  • Implement all the methods in the searching.py file in the searching directory.
  • Implement the count_sort algorithm in the iterative_sorting directory.
  • Implement an in-place version of merge_sort that does not allocate any additional memory. In other words, the space complexity for this function should be O(1).
  • Implement the timsort algorithm, which is a real-world sorting algorithm. In fact, it is the sorting algorithm that is used when you run Python's built-in sort method.

sorting's People

Contributors

seanchen1991 avatar br80 avatar et-code-home avatar birdcar avatar quintonmcnamee avatar beejjorgensen avatar briandoyle81 avatar jdorety 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.