Multiple sort (JavaScript)

xiaoxiao2021-03-05  51

Function Marge (SS, TS)

{

Var = new array (ss.length ts.length);

VAR m = 0;

VAR n = 0;

For (i = 0; i

{

IF (SS [M]) = ts.length)

{RS [I] = SS [M];

M

} // if

Else

{RS [I] = TS [N];

N

}

}

Str = "";

For (l = 0; l

{IF (l == rs.length-1)

Str = RS [L];

Else

Str = rs [l] ","

}

Return Str;

}

Var ms = new array ();

Function Install (C)

{

MS = C.Split (",");

}

Function sort ()

{n = Document.form1.textnum.value;

C = Document.form1.textResult.Value;

IF (n == 5)

Document.form1.text.Value = "DONE";

Else

{

MS = C.Split (",");

// install (c);

m = 1;

For (i = 0; i

{

M = m * 2;

}

STR1 = "";

STR2 = ""

For (j = 0; j <(ms.length / m); J )

{var ss = new arch arrAy (m / 2)

VAR TS = New Array (m / 2);

For (q = 0; q

{

SS [q] = ms [(j * m) Q];

TS [q] = ms [j * m m / 2 q];

}

Str1 = marge (s, ts);

IF (j == (ms.length / m) -1)

STR2 = STR1;

Else

STR2 = STR1 ","

}

n = parseint (n) 1

Document.form1.textResult.Value = str2;

Document.form1.textnum.value = n;

}

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

New Post(0)