Bubble sort en pascal

bueno aqui les dejo el codigo de el bubble sort en pascal, yo lo hice.

BUBBLE SORT CODE

PROGRAM bubblesorting;

{ MoYo }

USES CRT;

CONST

elementsinuse = 10;

TYPE

thearraytype = array [1..10] OF INTEGER;

VAR

currentindex, currentpass : integer;
tempvalue : integer;
thearray : thearraytype;

PROCEDURE bubble (thearray : thearraytype; elementsinuse : integer);

BEGIN

IF elementsinuse > 1 THEN
FOR currentpass := 1 to elementsinuse – 1 DO
FOR currentindex := 1 to elementsinuse – 1 DO
IF (thearray[currentindex + 1 ] <>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>