yxbdali / Advanced-Algorithms

100+ algorithm & data structure implementations in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advanced Algorithms

Various important computer science algorithms generically implemented in C#

Data Structures

List

Hash Set

Hash Dictionaries

Stack

Queue

Priority Queue

Linked List

Heap

Min

Note: Among the implementations here in practice, with the exclusion of DecrementKey operation regular Binary Heap & d-ary Heap outperforms other in theory superiors. Of course because it don't have pointer juggling nonsense and hey arrays are faster!

Max

Tree

Binary Search Trees

B Trees

Queryable Trees

LookUp Trees

Parse Trees

Set

Graph

Adjacency List

Algorithms

Graph Algorithms

Articulation Points

Bridges

Connectivity

Coloring

Cover

Max Flow

Shortest Path

Matching

Cut

  • Minimum Cut (Implementation | Tests) using Edmonds Karp's improved Ford Fulkerson Max Flow algorithm

Search

Topological Sort

Minimum Spanning Tree

String

Pattern Matching

Compression

Sorting and Searching

Sorting Algorithms

Note: On a decent desktop, in given implementations here for +ive random input integers, the clear winner is counting sort (~0.6 seconds to sort 1 million integers) followed by Radix Sort. Merge Sort, Heap Sort, Quick Sort & Bucket Sort are all winners for +ive & -ive random integer inputs with (~1 seconds to sort 1 million integers). Tree sort has pointer juggling overhead on backing Red-Black Tree, so performs 8 times slower than Merge Sort in practice. Bubble Sort, Insertion Sort, Selection Sort & Shell Sort are among the worst for random input as you might have guessed.

Numerical Methods

Classic Dynamic Programming Problems

All are top down solutions with memoization technique.

Matrix

Counting

Maximizing

Minimizing

Palindrome

Sequence

Sum

String

Other

Bit Algorithms

Geometry

Divide & Conquer

About

100+ algorithm & data structure implementations in C#

License:MIT License


Languages

Language:C# 100.0%