Article View: es.comp.os.linux.programacion
Article #9374Re: Numeros y arrays
From: Jose A
Date: Sun, 21 Jul 2002 16:35
Date: Sun, 21 Jul 2002 16:35
17 lines
1484 bytes
1484 bytes
Hola de nuevo.
El m�todo burbuja con while es un m�todo un poco improvisado, si
el que tienes que hacer es para una practica, el m�todo m�s correcto
es este:
for (indice = 0; indice < te; indice++) {
for (indice2 = 0; indice2 < te - 1; indice2++) {
if (array[indice2 + 1] < array[indice2]) {
tmp = array[indice2 + 1];
array[indice2 + 1] = array[indice2];
array[indice2] = tmp;
}
}
}
saludos.
Technical Details
Message-ID:
<slrnajloll.58d.MAQUI000@213.60.228.231>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!demon!btnet-peer0!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!cesio.mundo-r.com!localhost.localdomain!nobodyReferences:
<3D3AC81F.5080207@lycos.es> <slrnajlnd8.58d.MAQUI000@213.60.228.231>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,9edd6153a53e25f5 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-07-21 09:55:04 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!demon!btnet-peer0!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!cesio.mundo-r.com!localhost.localdomain!nobody From: MAQUI000@NOSPAM.mundo-r.com (Jose A) Newsgroups: es.comp.os.linux.programacion Subject: Re: Numeros y arrays Date: Sun, 21 Jul 2002 18:35:01 +0200 Organization: Another Netscape Collabra Server User Lines: 17 Message-ID: <slrnajloll.58d.MAQUI000@213.60.228.231> References: <3D3AC81F.5080207@lycos.es> <slrnajlnd8.58d.MAQUI000@213.60.228.231> NNTP-Posting-Host: 213.60.228.231 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit User-Agent: slrn/0.9.7.1 (Linux)