UNPKG

@allalgorithms/mergesort

Version:

Merge Sort algorithm from The All ▲lgorithm Project

66 lines (49 loc) 2.24 kB
<p align="center"> <a href="https://npmjs.com/@allalgorithms-mergesort"><img src="https://cdn.abranhe.com/projects/algorithms/logo.svg" width="20%"> </a> <br> <br> Merge Sort Algorithm for the <a href="https://allalgorithms.com">All ▲lgorithms Project</a> <br> <br> </p> <p align="center"> <a href="https://travis-ci.org/abranhe/allalgorithms-mergesort"><img src="https://img.shields.io/travis/abranhe/allalgorithms-mergesort.svg?logo=travis" /></a> <a href="https://github.com/abranhe/allalgorithms-mergesort/blob/master/license"><img src="https://img.shields.io/github/license/abranhe/allalgorithms-mergesort.svg" /></a> <a href="https://github.com/allalgorithms-mergesort"><img src="https://cdn.abranhe.com/projects/algorithms/badge.svg"/></a> <a href="https://github.com/abranhe/allalgorithms/allalgorithms-mergesort"><img src="https://img.shields.io/npm/v/allalgorithms-mergesort.svg"/></a> </p> ## Install ``` npm install @allalgorithms/mergesort ``` ## Usage Example ```js const mergeSort = require('@allalgorithms/mergesort'); arr = [77, 2, 10, -2, 1, 7] console.log(mergeSort(arr)); // -> [-2, 1, 2, 7, 10, 77] ``` # Related - [allalgorithms-js](https://github.com/abranhe/allalgorithms-js): All ▲lgorithms Javscript library - [allalgorithms-python](https://github.com/abranhe/allalgorithms-python): All ▲lgorithms Python library - [allalgorithms-java](https://github.com/abranhe/allalgorithms-java): All ▲lgorithms Java library # Maintainers |[![Carlos Abraham Logo][3]][4]| | :--------------------------: | | [Carlos Abraham][4] | # License [MIT][5] License © [Carlos Abraham][4] <!-------------------Markdown Images Links ----------------------------------> [1]: https://cdn.abranhe.com/projects/algorithms/badge.svg [2]: https://github.com/abranhe/allalgorithms-mergesort [3]: https://avatars3.githubusercontent.com/u/21347264?s=50 [4]: https://github.com/abranhe [5]: https://github.com/abranhe/allalgorithms-mergesort/blob/master/license <!-------------------Markdown Images Links ----------------------------------> <p align="center"> <a href="https://github.com/abranhe/algorithms"> <img src="https://cdn.abranhe.com/projects/algorithms/logo.svg" width="50px"> </a> <br> </p>