🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #3439

Re: ordinamento

#3439
From: lorenzo
Date: Wed, 17 Jul 2002 13:06
43 lines
2913 bytes
"Sergio(R)" <sergio_digiorgi@tin.it> ha scritto nel messaggio
news:qba6jughm6brec6ad3h2eubj5fbfu0mirb@4ax.com...
> On Mon, 15 Jul 2002 11:27:53 GMT, "lorenzo" <sirio32-togli il txt tra le
> lineette se mi vuoi rispondere in pers-@iol.it> wrote:
>
> E' un problema piuttosto comune. Uno dei piu' veloci e' quello con
> l'algoritmodi Metzner. Questa e' la versione in QB, se vuoi farlo con una
> CALL, convertirlo e' abbastanza semplice.
>
> REM ******************* Sort *********************************
>       N% = NumMax%: M% = Y% + 1
> SRT001:
>       M% = INT(M% / 2): IF M% = 0 THEN RETURN
>       J% = 1: K% = N% - M%
> SRT002:
>       IF J% > K% THEN GOTO SRT001
>       I% = J%
> SRT003:
>       IF I% < 0 THEN GOTO SRT004
>       IF TABSOR$(I% + M%) < TABSOR$(I%) THEN GOTO SRT005
> SRT004:
>       J% = J% + 1: GOTO SRT002
> SRT005:
>       SWAP TABSOR$(I%), TABSOR$(I% + M%)
>       I% = I% - M%: GOTO SRT003
>
> --
> Ciao
> Sergio�


ti ringrazio, mi � stato d'aiuto per la sintassi anche se poi ho deciso di
fare pi� di qualcosa di testa mia. Ho costruito una procedura funzionante
per un array di dati casuali. Ho fatto qualche statistica e si � rivelata
funzionale (diciamo cos�). Ora devo ottimizzarla  (50 dati in 0.285sec e 100
dati in 1.056sec in media per i dati semplici senza copia incolla ecc.) ma
la metto subito in linea perch� ho bisogno dell'ordinamento.
non posto il listato perch� � molto lungo ma se qualcuno ne fosse curioso
della sintassi in VBA me lo dica che glielo invio.

Grazie.
Ciao a tutti
Lorenzo
Technical Details
Message-ID: <sZdZ8.76542$Jj7.1980880@news1.tin.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
References: <iQyX8.71896$vm5.2619539@news2.tin.it> <m3QX8.30667$K_4.710864@twister1.libero.it> <qmuY8.79906$vm5.2917479@news2.tin.it> <_HwY8.41277$7N3.949074@twister2.libero.it> <ZkyY8.81216$vm5.2949830@news2.tin.it> <qba6jughm6brec6ad3h2eubj5fbfu0mirb@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,bb98a523e4be6de2
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2002-07-17 06:11:58 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!news-out.tin.it!news-in.tin.it!news1.tin.it.POSTED!not-for-mail
From: "lorenzo" <sirio32-togli il txt tra le lineette se mi vuoi rispondere in pers-@iol.it>
Newsgroups: free.it.visual-basic
References: <iQyX8.71896$vm5.2619539@news2.tin.it> <m3QX8.30667$K_4.710864@twister1.libero.it> <qmuY8.79906$vm5.2917479@news2.tin.it> <_HwY8.41277$7N3.949074@twister2.libero.it> <ZkyY8.81216$vm5.2949830@news2.tin.it> <qba6jughm6brec6ad3h2eubj5fbfu0mirb@4ax.com>
Subject: Re: ordinamento
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <sZdZ8.76542$Jj7.1980880@news1.tin.it>
Date: Wed, 17 Jul 2002 13:06:32 GMT
NNTP-Posting-Host: 212.216.39.222
X-Complaints-To: newsmaster@tin.it
X-Trace: news1.tin.it 1026911192 212.216.39.222 (Wed, 17 Jul 2002 15:06:32 MET DST)
NNTP-Posting-Date: Wed, 17 Jul 2002 15:06:32 MET DST
Organization: TIN