![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
Insert sorting algotihm problem
Hi. I have problem with my insert sorting algorithm. Here is code:
This code sorts: 1,2,3,4,5,6 Code:
for j:=1 to y do
begin
tmp:=mas[i,j];
n:=j-1;
while ((n>=0) and (mas[i,n]>tmp)) do
begin
mas[i,n+1] := mas[i,n];
n:=n-1;
end;
mas[i,n+1]:=tmp;
end;
Code:
for j:=1 to y do
begin
tmp:=mas[i,j];
n:=j-1;
while ((n>=0) and (mas[i,n]>tmp)) do
begin
mas[i,n+1] := mas[i,n];
n:=n-1;
end;
mas[i,n+1]:=tmp;
end;
end;
|
|
|
|
![]() |
| Thread Tools | |
|
|