Quick Sort Law JScript Edition

xiaoxiao2021-03-06  117

The rapid sorting method is a classic algorithm. Generally, the efficiency is highly bubbling, which is very useful in the table data sort of the web client. The JScript implementation of the algorithm is given below, because the algorithm is very simple, it will not add a comment. Function Quicksort (Data, Low, High, Bgreater) {var MID = DATA [Low]; var index = low; for (var i = low 1; i <= high; i ) {var Needswap = false; if (bgreater Needswap = DATA [I] MID; IF (Needswap) {INDEX ; SWAP (Data, I, INDEX);}} Swap (Data, INDEX, LOW); IF (Index - 1> Low) Quicksort (Data, Low, INDEX - 1, BGReater); IF (INDEX 1

转载请注明原文地址:https://www.9cbs.com/read-99385.html

New Post(0)