Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.01 KB

File metadata and controls

34 lines (28 loc) · 1.01 KB

Data Structures and Algorithms in C#

This repo is to implement data structures and common useful algorithms in C#. It started out as my journey to learn C# as a Java dev and I thought it might help someone in a similar position as me.

All the code written is tested with xUnit and .NET 7. I have tried to follow a TDD design. Generics have been used to provide support for most types.

Data Structures

The following have been implemented.

  • Linked List
    • Add element to head.
    • Add element to tail.
    • Remove element from head.
    • Remove element from tail.
  • Trees
    • Traversals - Preorder, Inorder, Postorder, Level-order
  • Graphs
    • Graph creation.
    • Traversals - Depth-first search (DFS). Breadth-First search (BFS).
  • Set
    • HashSet with collision handling using chaining technique.
  • Map
    • HashMap with collision handling using chaining technique.

Algorithms

The following have been implemented.

  • Sorting
    • Bubble Sort
    • Merge Sort
    • Quick Sort (Randomized)
    • Insertion Sort
    • Selection Sort