Quick sorting (2)

xiaoxiao2021-04-06  262

/ ** * Reference: http://caterpillar.onlyfun.net/gossip/algorithmgossip/quicksort3.htm *

Title: *

description: *

Copyright: CopyRight (c) 2006 *

Company: * @Author not attributable * @version 1.0 * / public class quicksort1 {public static void swap (int]) Number, Int i, int J) { / / Switch the value INT TMP; TMP = Number [i]; Number [i] = Number [J]; Number [J] = TMP;} public static void sort (int [] Number, INT LEFT, INT Right) {IF (Left

Public static void print (int [] number) {// Print input array content for (int i = 0; i

Public static void main (string [] args) {int [] Number = {2, 8, 7, 1, 3, 5, 6, 4}; sort (Number, 0, Number.length - 1);

Print (Number);}}

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

New Post(0)