Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Fondamenti di architettura e programmazione > [JAVA][HELP] BinarySearch
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Ikkarus
.illuminato.

User info:
Registered: Sep 2004
Posts: 164 (0.02 al dì)
Location: Melzo
Corso: Comunicazione Digitale
Anno: 3
Time Online: 1 Day, 6:43:37 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
BinarySearch

salve qualcuno saprebbe descrivermi il metodo BinarySearch o di rmi dove posso trovare info dettagliate su questa classe??grazie

03-01-2005 14:45
Click Here to See the Profile for Ikkarus Click here to Send Ikkarus a Private Message Find more posts by Ikkarus Add Ikkarus to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Just
.illuminato.

User info:
Registered: Sep 2004
Posts: 202 (0.03 al dì)
Location: Merate
Corso: Comunicazione Digitale
Anno: Secondo
Time Online: 5 Days, 14:15:46 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Anche a me servirebbbero delle informazioni su binarySearch e sort. mi da continuamente errore in qualsiasi modo lo scrivo. come si fa ? Grazie
Just

07-01-2005 09:20
Click Here to See the Profile for Just Click here to Send Just a Private Message Find more posts by Just Add Just to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Sandro
.primate.

User info:
Registered: Jan 2003
Posts: 78 (0.01 al dì)
Location: Milano
Corso: TiCoM
Anno:
Time Online: 9 Days, 0:18:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

idem...nn riesco a trovarlo..

07-01-2005 10:00
Click Here to See the Profile for Sandro Click Here to See the Blog of Sandro Click here to Send Sandro a Private Message Find more posts by Sandro Add Sandro to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
patchbay
.novellino.

User info:
Registered: Sep 2004
Posts: 3 (0.00 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: 1
Time Online: 1:45:34 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
sort & binarySearch

il metodo sort(), è un metodo sovracaricato e accetta vari argomenti (vedi documentazione API), nel nostro caso deve essere utilizzato per ordinare un array di oggetti rappresentanti figure. Il suo utilizzo è molto semplice, esempio:

Shape [] figure=new Shape[int];
..........

//una volta riempito l'array utilizzo il metodo

java.util.Arrays.sort(figure);

//notare che gli elementi presenti nell'array devono necessariamente implementare l'interfaccia comparable!!

binarySearch (sempre nel nostro caso, per elementi diversi da oggetti vedi API) esegue una ricerca binaria all'interno di un array precedentemente ordinato (non sarebbe possibile la ricerca binaria stessa) ,ritornando l'indice e quindi la posizione nel caso in cui lelemento sia presente all'interno dell'array, quindi dopo aver ordinato l'array tramite sort:

//per es. se vogliamo vedere se presente un cerchio con raggio 3.14

Shape nuovaFigura=new Circle(3.14);

int posizione=java.util.Arrays.binarySearch(figure,nuovaFigura);

video.print(pos);
...........

ricordo che in questo modo vediamo se presente la stessa figura,
lascio a voi l'implementazione di comparare per area le figure spero di essere stato di aiuto..........bye!!:)

10-01-2005 10:43
Click Here to See the Profile for patchbay Click here to Send patchbay a Private Message Find more posts by patchbay Add patchbay to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 06:41.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.033 seconds (79.15% PHP - 20.85% MySQL) con 26 query.