HackIt !
Would you like to react to this message? Create an account in a few clicks or log in to continue.

HackIt !

Bine ai venit pe HackIt!
 
HomeSearchRegisterLog in

 

 clasificare vectori

Go down 
AuthorMessage
l@na
Admin
l@na

Posts : 2
Join date : 2011-10-09
Age : 25

clasificare vectori Empty
PostSubject: clasificare vectori   clasificare vectori I_icon_minitimeSun Oct 09, 2011 11:00 am

Metoda Selectiei 1

for i:=1 to n-1 do
for j:=1 to n do
if a[i]<a[j] then
begin
aux:=a[i];
a[i]:=a[j];
a[j]:=aux;
end;


Metoda Selectiei 2

for i:=1 to n-1 do
for j:=1 to n-i do
if a[j]<a[j+1] then
begin
aux:=a[j];
a[j]:=a[j+1];
a[j+1]:=aux;
end;

Metoda Bulelor

REPEAT
gasit:=false;
for i:=1 to n-1 do
if a[i]<a[i+1] then
begin
aux:=a[i];
a[i]:=a[i+1];
a[i+1]:=aux;
gasit:=true;
end;

UNTIL not gasit;
Back to top Go down
https://hackit.iftopic.com
 
clasificare vectori
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
HackIt ! :: Scoala! :: Pascal-
Jump to: