TI-Cpp / main-core-sorting-algo

Basic implementation of core Computer Science algorithms and data structures written in C#. Major sorting algorithms need to be implemented.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Core Concepts

Basic implementation of core Computer Science algorithms and data structures written in C# and packaged as .NET Core assembly. Hence, the choice to use core :-)

This project was primarily influenced by the following StackOverflow question and popular answer, my desire to create a cross-platform library and more importantly, help anyone interested in learning the fundamentals.

Goals

  • Provide implementations to standard algorithms/data structures
  • Include unit tests to verify functionality
  • Write clean and straightforward code with helpful comments
  • No dependency on third-party libraries

Implementations

Notes

Sample

  • Binary Search
int[] array = new int[] { 1, 2, 15, 35, 46, 78, 100 };
int index = BinarySearch.Search(array, 35);
// Will return 3
  • Bubble Sort
int[] unsortedArray = new[] { 300, 5, 1, 8, 100, 2, 10 };
BubbleSort.Sort(unsortedArray);
// Will produce [1, 2, 5, 8, 10, 100, 300]
  • Insertion Sort
int[] unsortedArray = new int[] { 38, 27, 43, 3, 9, 82, 10 };
InsertionSort.Sort(unsortedArray);
// Will produce [3, 9, 10, 27, 38, 43, 82]
  • Selection Sort
int[] unsortedArray = new int[] { 300, 5, 1, 8, 100, 2, 10 };
SelectionSort.Sort(unsortedArray);
// Will produce [1, 2, 5, 8, 10, 100, 300]
  • Stack
using Core = CoreConcepts.DataStructures.Linear;

Core.Stack<int> stack = new Core.Stack<int>();

int itemsToPush = 5;
for (int i = 1; i <= itemsToPush; i++)
{
    stack.Push(i);
}

for (int i = itemsToPush; i > 0; i--)
{
    int value = stack.Pop();
}

About

Basic implementation of core Computer Science algorithms and data structures written in C#. Major sorting algorithms need to be implemented.

License:MIT License


Languages

Language:C# 100.0%