mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-18 16:08:19 +02:00
Update measure-MergeSort.ps1
This commit is contained in:
parent
02ad290752
commit
b9b6e0aa2f
@ -1,4 +1,25 @@
|
|||||||
param([int]$numIntegers = 1000)
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Measures the speed of MergeSort
|
||||||
|
.DESCRIPTION
|
||||||
|
This PowerShell script measures the speed of the MergeSort algorithm.
|
||||||
|
MergeSort is an efficient, general-purpose, and comparison-based sorting algorithm.
|
||||||
|
Most implementations produce a stable sort, which means that the order of equal elements
|
||||||
|
is the same in the input and output. Merge sort is a divide-and-conquer algorithm that
|
||||||
|
was invented by John von Neumann in 1945. A detailed description and analysis of bottom-up
|
||||||
|
merge sort appeared in a report by Goldstine and von Neumann as early as 1948.
|
||||||
|
.PARAMETER numIntegers
|
||||||
|
Specifies the number of integers to sort
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./measure-MergeSort.ps1
|
||||||
|
🕒 MergeSort of 1000 integers took 0.3786619 sec
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz | License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
param([int]$numIntegers = 1000)
|
||||||
|
|
||||||
class MergeSort {
|
class MergeSort {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user