Quicksort
The quicksort is the fastest known comparison-based sorting algorithm, with a growth rate of O (n log n) on average. However, in the worst case, this degrades to O (n[sup]2[/sup]), but this can be mostly avoided if implemented carefully.
Below is the pseudo-code of Quick Sort.
Quick Sort (Sorting array A[size])
While Low is less than High
{
Choose Pivot as the element at position A[Low]
While A[High] is greater than Pivot, decrement High; else move A[High] to A[Low]
While A[Low] is less than Pivot, increment Low; else move A[Low] to A[High]
}
Move Pivot into A[High], see Pivot position as High.
If Low is less than Pivot point, recursively call Quick Sort with Low =
Low, High = Pivot point - 1
If High is greater than Pivot point, recursively call Quick Sort with Low =
Pivot point + 1, High = High.Related Tutorials
Balancing Game Development and Creative Direction in Indie Production
A practical look at how indie developers can balance creative direction with hands-on game development. This article co…
My Unreal Engine Development Process: From Core Idea to Playable Build
A practical overview of my Unreal Engine development process, covering how I move from a core game idea to a playable b…
Introducing LaneGraph: The Ultimate Road Network Solution for Unity
Discover the power of LaneGraph, a lightweight and flexible lane-based navigation system for Unity. LaneGraph makes it…
Retargeting Mixamo Characters with Root Motion In Unreal Engine 5.4.
I have always found Retargeting Mixamo Characters To have Root Motion is a serious lengthy Tast, Recently I stumbled up…
How To Make A SIMPLE Main Menu In Unity
In this tutorial for unity, i go over how to make a simple main menu for unity, it's an unlisted video because i do not…
Guide to Gameplay Balance
A perspective on competitive gameplay balance, from a background of "shooter" sandbox design.
Discussion
More from Yin-So Chen
Comparing Shadow Mapping Techniques with Shadow Explorer
New Incentives and a Whole New Platform From The Intel AppUp developer program
The final installment in this series on Intel's AppUp program details additional incentives and opportunities for devel…
The Game Maker
This book excerpt contains the first chapter of the book that introduces beginning game developers to the Game Maker pr…
Discussion