Skip to content

semerdzhiev/sdp-samples

Repository files navigation

Data structures and algorithms in C++

The repository contains implementations of different data structures and algorithms in C/C++. They are intended to be used as educational examples.

The examples are grouped in directories, by topic, as follows:

Contents

Array Waling

A simple demonstration of the effects of locality on performance.

DynamicArray

  1. Simple - A simple, C-style implementation
  2. DynamicArray - An object-oriented implementation. Also demonstrates proxies, operator ovearloading.

Hash

Contains implementations of separate chaining and linear probing hashes

LabyrinthBoard

Demonstrates breadth-first and depth-first searching over a square, chess-like board.

LinkedList

An implementation of a linked list

Sorting

  1. Sorting - Implementations of the most popular sorting algorithms. Also includes unit tests.
  2. merge-sort-simple-2016.cpp - a very simple (50 lines) merge sort
  3. merge-sort-linked-list.cpp - generic merge sort over templated linked ist
  4. merge-sort-static-list.cpp - merge sort on static list (not so smart implementation)

Stack

  1. Stack - contains static, fixed size and linked implementations of a stack.
  2. StackTest - demonstrates the use of unit tests, using a custom unit test framework.

Combinatorial & Data Structures w/STL

  1. combinations-2016.cpp - gen all combinations of N elements K class
  2. huffman-modernist.2016.cpp - brief huffman coding w/C++11 stuff in it
  3. maze-recursive.2016.cpp - walking a maze in plain C
  4. fsm-simple.stl-2016.cpp - some C++11 magic put to work into simple Finite State Automata

About

Samples in C++ for data structures

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published