Skip to content

About

C# implementations of core data structures and algorithms: circular queue, binary/BST/AVL trees with full rotation handling, greedy knapsack selection, and a weighted graph with BFS, DFS and least-risk route traversal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

C# Algorithms and Data Structures

Four console and WinForms projects implementing core data structures and algorithms in C# from first principles — queues, binary and AVL trees, greedy selection, complexity analysis, and graph traversal.

All four projects build cleanly against .NET Framework 4.7.2 with no external dependencies.

Projects

src/01-guest-queue-manager — Circular Queue

A fixed-capacity circular queue backed by a plain array, with a WinForms interface.

  • Enqueue, Dequeue, Peek, Count, IsEmpty, IsFull over a wrapping head/tail index
  • Contains for name lookup and GetMostFunds to find the highest-value guest
  • Reverse(k) to reverse the first k elements of the queue
  • Guest implements IComparable for ordering

src/02-avl-film-library — Binary, BST and AVL Trees

A three-layer tree hierarchy where each class extends the last, storing a Film catalogue.

  • BinTree<T> — base binary tree with recursive PreOrder, InOrder, PostOrder traversal, Height and Count
  • BSTree<T> — ordered insert, remove and Update, using LeastItem to find the in-order successor when removing a two-child node
  • AVLTree<T> — self-balancing insert and remove, computing balance factors and applying all four rotation cases (LL, LR, RR, RL)

src/03-sorting-greedy-analysis — Greedy Selection and Complexity

  • GetGreedyManifesto — a greedy knapsack solver selecting items by value-to-weight ratio under a weight limit
  • InsertSortGen<T> — generic insertion sort constrained to IComparable
  • BigOFunctions — worked complexity analysis, counting operations per line and reducing to Big-O

src/04-graph-traversal-network — Weighted Graph and Traversal

A generic graph over LinkedList<GraphNode<T>> holding a network of Loot items.

  • Node and edge construction, including weighted edges
  • Adjacency lookups: GetAdjacencyIDs, GetAllAdjacencies, GetWeights
  • Metrics: NumNodes, NumEdges, AverageOutbound, AverageWeight
  • BFS and DFS traversal, plus SafestRoute — a least-risk path traversal using a priority queue to always expand the lowest-weight edge available

Tech Stack

  • C# / .NET Framework 4.7.2
  • WinForms (queue manager UI)
  • Visual Studio project files

Building

Open any project in Visual Studio 2022 and build, or from the command line:

msbuild src/02-avl-film-library/ADSPortEx2.csproj /t:Rebuild /p:Configuration=Debug

The three console projects (02, 03, 04) each launch a menu-driven interface for exercising the data structures. Project 01 opens a WinForms window.

Notes

These began as university coursework and have been cleaned up for portfolio use: build output, IDE metadata, and unused NuGet references have been removed, leaving only the implementation work.

About

C# implementations of core data structures and algorithms: circular queue, binary/BST/AVL trees with full rotation handling, greedy knapsack selection, and a weighted graph with BFS, DFS and least-risk route traversal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages