allalgorithms-python

Merge Sort

In computer science, merge sort is an efficient, general-purpose, comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output

Install

pip install allalgorithms

Usage

from allalgorithms.sorting import merge_sort

arr = [77, 2, 10, -2, 1, 7]

print(merge_sort(arr))
# -> [-2, 1, 2, 7, 10, 77]

API

merge_sort(array)

Returns a sorted array

Params:
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy