Bunkerbuster / MergeSort

Merge sort algorithm in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Merge Sort Algorithm

Source : (Java example) [https://www.youtube.com/watch?v=3j0SWDX4AtU]

Merge Sort

Table of Contents

About

This repository contains an implementation of the Merge Sort algorithm in C#. The code includes classes for the Merge Sort algorithm, a helper class for merging, and a controller for demonstrating the algorithm on various arrays.

The Merge Sort is a popular sorting algorithm that follows the divide-and-conquer paradigm. It divides the input array into two halves, recursively sorts each half, and then merges the sorted halves to produce a sorted array.

Usage

To use the Merge Sort algorithm in your C# project, follow the example provided in the Example section.

Getting Started

Follow these instructions to get a copy of the project up and running on your local machine.

Prerequisites

To run this project, you need to have:

Installation

  1. Clone this repository to your local machine using your terminal or command prompt:
git clone https://github.com/Bunkerbuster/MergeSort.git

Example

Here's an example of how to use the Merge Sort algorithm in C#:

private readonly int[] _UnsortedArray = new[] { 64, 34, 25, 12, 22, 11, 90 };

private readonly IMergeSortAlgorithm _IMergeSortAlgorithm;

[HttpGet("PrintSortedArray")]
public async Task<ActionResult> PrintMergedArray()
{
    int[] _SortedArray = _IMergeSortAlgorithm.MergeSortArray(_UnsortedArray);

    return Ok(_SortedArray);
}

##Contributing none

##Licence Apache-2.0

About

Merge sort algorithm in C#

License:Apache License 2.0


Languages

Language:C# 100.0%