/AlgorithmsAndDatastructures

A repository of neat algorithms and data structures with details on how to implement them and why they're useful.

Primary LanguageC++MIT LicenseMIT

Algorithms and Datastructures

A repo for showing off cool and neat datastructures and algorithms. Either for the purpose of getting better at interviewing or just to learn more.

This repo will contain detailed examples of implementations, as well as reasons for what makes a particular algorithm better than another, or the advantages/disadvantages of different approaches.

I plan for this repo to become a resource for learning about algorthims and datastructures in a particle but also fun way.

I want anyone to be able to contribute and add more interesting algorithms/data structures as the repo grows. If you're interested in contributing, read the steps outlined here.

The code will be written using whatever language the writer prefers as the main purpose of this isn't about learning a specific programming language but about understanding the concepts behind the algorithms and data structures.

Table of Contents

String

Sorting

Linked-List

Stack

Graphs

Trees

Dynamic Programming

Contributing

How do I contribute?

We want to keep this project simple, but also organized. The way we plan to structure this repository is by having subdirectories of over-arching topics. For example, we have a String folder, this folder will contain algorithms/data structures related to strings. Each algorithm will be contained within it's own folder.

For example, if you were to add isPalindrome algorithm, this tends to be related to strings. Thus, you would first either create the String subfolder or if it's already there, skip this part. Then you would create a folder with the name of the algorithm no space. That is we would have this folder structure: String/isPalindrome/ inside of isPalindrome you would have the required two files, but you may have more. The two required files are README.md, and the source file which contains the code implementation.

What do I put in the README?

Simply put an explanation of the algorithm, pretend that the person reading it understands programming but has never seen/heard of the algorithm you are implementing. If you want to put a live demo as well you can share a link to a repl. Here is a good site for that: Repl.it.

Start the README with the name of the algorithm using header 2 ## markdown style, and then underneath use header 3 ### styling for the time/space complexity of the algorithm, if it's a datastructure you may feel free to skip the complexity calculation at the top. But you must describe the complexity of each function in the data structure.

What do I put in the source file?

For this one you can feel free to use whatever language you prefer, as this repo is meant to be language agnostic and more about the actual topics. Just please make sure you have a working implementation that's been tested. Also, try to write your code in a readable manner.

Just give me a checklist man, I hate reading...

  • Make sure directories are structured in a clean way, that is, Topic/algorithm/ example: String/isPalindrome/
  • Include a detailed README, take a loot at this for an example.
  • Include a source file with neat code.
  • Update this (main) README file with your changes, that is adding a link to the algorithm.
  • Create a pull request so we can merge your changes!