Algorithms Review Game

This is a reference tool to supplement the study of an introduction to Algorithms.

A user can declare a sorting algorithm, and then an array of randomly generated integers will then be sorted by that array.

Motivation

I created this project whilst reviewing for my final Algorithms exam. I wanted a tool that could quickly generate random arrays of integers, and then pass them through various sorting algorithms.

I found it useful to visualize each iteration of the array as the algorithm works through doing its sorting. This feature allows me to quickly remember the characteristics of any given sorting algorithm.

Furthermore, I wanted to apply theory I had learned in studying algorithms towards my studies in Java and the OO paradigm.

##Installation

  1. Navigate to the location of the downloaded src folder.

  2. Compile the java files in your terminal: javac *.java.

  3. Run the Main.java class: java Main.

Usage

Commands to enter into the main menu when prompted:

  • selection sort Implements selection sort onto a randomly generated array of integers, displaying each iteration of the array as it is traversed from 0 to n-1.

  • insertion sort Implements insertion sort onto a randomly generated array of integers, displaying each iteration of the array as it is traversed n times.

  • play game Initiates a quiz mode that cycles through a randomly selected algorithm type and asks the user to guess the amount of iterations required before array is sorted.

  • master theorem Produces a random equation and solves the recurrence.

  • exit Exits the program, and saves your first name so that it can be recalled the next time you start the program.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D