/dsa

Data structures and algorithms that might be useful for ACM training.

Primary LanguageJava

Data Structures and Algorithms

A (hopefully) comprehensive list of data structures and algorithms useful in programming contests.

Introduction

The aim of this repository is to provide a central hub with robust implementations of the data structures and algorithms one might encounter during algorithmics programming contests.

Most of the inspiration comes from here. Another website with a similar goal is here.

Table of Contents

Data structures

Algorithms

Mathematics
  • Euclidean algorithm for determining the greatest common divisor: C++, Java
  • Extended Euclidean algorithm: C++, Java
  • Sieve of Eratosthenes: C++, Java
Dynamic Programming
  • Longest common substring: C++, Java
Graph algorithms
  • Basic algorithms:

  • Shortest path algorithms:

    • Roy-Floyd algorithm for determining the all-pairs shortest paths: C++, Java
String algorithms
  • Pattern matching:
    • Knuth-Morris-Pratt algorithm: C++, Java

Compiling

To compile the C++ files, run this at a command prompt:

g++ -o test --std=c++11 <filename.cpp>

License

MIT License

© 2013 Sebastian Claici <sebastianclaici@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.