Repository navigation
Quicksort Algorithm in C#: .NET 10 update and corrected benchmark - #2348
Open
vladimir-pecanac-main wants to merge 1 commit into
Open
vladimir-pecanac-main wants to merge 1 commit into
vladimir-pecanac-main wants to merge 1 commit into
Conversation
…and tests Retarget both projects to net10.0 and update BenchmarkDotNet, MSTest, Test SDK and coverlet. SortArray drops the benchmark-only fourth parameter so it matches the article. The new QuickSortBenchmarks class copies the source array per call so unsorted input stays unsorted, and compares the first-element pivot, a middle-element pivot and Array.Sort at 200, 1000 and 2000 elements. Tests cover the article array, random input against Array.Sort, and 100,000 presorted elements with the middle pivot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retargets csharp-algorithms/QuickSort to net10.0 with BenchmarkDotNet 0.15.8, MSTest 4.5.2, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0. SortArray loses the benchmark-only fourth parameter so it matches the article, a middle-element pivot variant sits next to it, and a new QuickSortBenchmarks class copies the source array on every call so the unsorted case really is unsorted, comparing both pivots with Array.Sort at 200, 1000 and 2000 elements. The tests now cover the article's nine-element array, 2,000 random elements against Array.Sort, and 100,000 presorted elements with the middle pivot.