Skip to content

A versatile project with a comprehensive collection of basic algorithms designed for easy customization

License

Notifications You must be signed in to change notification settings

JakubKorytko/algorithms-library

Repository files navigation

Algorithms Library

MIT license Visual Studio .Net

Open Source Love svg1 Run Super-Linter

Table of Contents

Introduction

The Algorithms Library is a versatile C# project that provides a comprehensive collection of basic algorithms implemented within the .NET 4.7.3 framework. This library is designed with extensibility in mind, allowing users to easily add their own algorithms.

It's a great tool for learning algorithms and their implementation. It also allows you to quickly test your own algorithms or create a collection of your favorite / custom algorithms.

It is built using the Visual Studio 2022.

This project was created targeting Windows. It has not been tested on other operating systems.

Prerequisites

Before using the Algorithms Library, make sure that you have the following prerequisites installed on your system:

Installation

  1. Clone this repository to your local machine using Git, or download the ZIP file and extract it to a directory of your choice:

    git clone https://github.com/JakubKorytko/algorithms-library.git
  2. Change to the project directory:

    cd algorithms-library
  3. In Visual Studio, open the `AlgorithmsLibrary.sln' solution file.

  4. Build or run the project in Visual Studio:

    • Run the project in the Visual Studio

      • F5 / Ctrl + F5 by default
      • or Debug -> Start Debugging / Start Without Debugging on the toolbar
    • or Build project executable

      • Ctrl + B / Ctrl + Shift + B by default
      • or Build -> Build Solution / Build AlgorithmsLibrary on the toolbar

    The executable will be available in the build directory in both cases.

Usage

Menu

The application has an intuitive text-based menu. When launched, the menu is displayed and the application waits for your input (case-insensitive).

Available commands

  • <algorithm_name> - execute the selected algorithm
  • menu - show the menu options
  • exit

Available algorithms

Extending the library

Adding new algorithms

Add a new class to the Components/Algorithms folder. Make sure that the class is derived from the Algorithm class (AlgorithmsLibrary.AlgorithmsCore namespace).

Also, the class should:

  1. Override the public void method named Display which is used to execute the algorithm (you must handle the output within this function)

    • IF NOT: The application displays No display method defined for this algorithm when you try to select it from the menu.
  2. Override the public virtual string Description:

    public override string Description { get { return "..."; } }
    • IF NOT: The application displays No description provided for this algorithm next to it in the printed menu.
  3. Have a unique class name that is displayed in the menu.

For example, see Components/Algorithms/Algorithm.example.cs

Adding shared methods

If you need to add a method that is available to all algorithms, add a new method to the Components/AlgorithmsCore/BaseClassTools.cs file.

The file contains a sample method that you can check to create your own.

(Also, there are already some methods there to parse integers from the input, check them out if you are interested).

Contributing

If you find issues or have suggestions for improvements, feel free to open an issue or submit a pull request. Contributions are welcome!

Contact

If you have any questions, feel free to contact me at [email protected].

License

This project is released under the MIT License. See the LICENSE file for details.

About

A versatile project with a comprehensive collection of basic algorithms designed for easy customization

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages