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 N - Z > Programmazione > Java Alberi
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
kalbiz
.primate.

User info:
Registered: Oct 2002
Posts: 72 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno:
Time Online: 2 Days, 16:48:32 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Post Java Alberi

ciao,
come si fa ad accedere all'ultimo elemento di un'albero, mi è chiaro come si scorra l'intero albero ma non come si faccia a visualizzare il solo ultimo elemento...

grazie

16-10-2002 09:59
Click Here to See the Profile for kalbiz Click here to Send kalbiz a Private Message Find more posts by kalbiz Add kalbiz to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
chobin
.fedelissimo.

User info:
Registered: Jul 2002
Posts: 48 (0.01 al dì)
Location: Prov di BG
Corso: Informatica
Anno: Finito da tempo...
Time Online: 4 Days, 12:51:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

che tipo di albero? binario d ricerca?e cosa intendi per "ultimo"? il piu grande?Il piu piccolo?Cmq il piu piccolo è il piu a sx,il piu grande il piu a dx.. Basta visitare nella direzione che ti serve fino a null.. Spero sia quello che volevi saopere,senno prova a spiegare meglio.. Ciao

16-10-2002 12:11
Click Here to See the Profile for chobin Click here to Send chobin a Private Message Find more posts by chobin Add chobin to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
kalbiz
.primate.

User info:
Registered: Oct 2002
Posts: 72 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno:
Time Online: 2 Days, 16:48:32 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

diciamo che stavo cercando il più grande in un albero binario, la condizione necessaria è semplicemente che sia sul ramo dx e che vada a null???

ciao

16-10-2002 12:17
Click Here to See the Profile for kalbiz Click here to Send kalbiz a Private Message Find more posts by kalbiz Add kalbiz to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
chobin
.fedelissimo.

User info:
Registered: Jul 2002
Posts: 48 (0.01 al dì)
Location: Prov di BG
Corso: Informatica
Anno: Finito da tempo...
Time Online: 4 Days, 12:51:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

beh,si... La foglia piu a dx..

16-10-2002 12:34
Click Here to See the Profile for chobin Click here to Send chobin a Private Message Find more posts by chobin Add chobin to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
kalbiz
.primate.

User info:
Registered: Oct 2002
Posts: 72 (0.01 al dì)
Location: Milano
Corso: Informatica
Anno:
Time Online: 2 Days, 16:48:32 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

mi hanno suggerito, che bisogna scendere nell'albero sul ramo destro, e l'ultimo elemeto è quello che non ha più figli...

17-10-2002 16:35
Click Here to See the Profile for kalbiz Click here to Send kalbiz a Private Message Find more posts by kalbiz Add kalbiz to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
darklady
.:Ingegnere:.

User info:
Registered: Nov 2001
Posts: 387 (0.04 al dì)
Location: Merate
Corso:
Anno:
Time Online: 12 Days, 3:32:18 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by kalbiz
mi hanno suggerito, che bisogna scendere nell'albero sul ramo destro, e l'ultimo elemeto è quello che non ha più figli...


è vero..cmq se guardi sui libri ci sono tre tipi di attraversamento: inordine, preordine e postordine...e ognuno scorri i nodi del'albero in modo diverso dall'altro...
cmq è una semplice funzione ricorsiva..che richiama se stessa n volte(almeno in pascal e c è cosi:p)
:D

19-10-2002 12:03
Click Here to See the Profile for darklady Click here to Send darklady a Private Message Visit darklady's homepage! Find more posts by darklady Add darklady to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
nous
.:Retore Pomposo:.

User info:
Registered: Dec 2001
Posts: 2945 (0.33 al dì)
Location: Fino Mornasco - Como
Corso: Informatica
Anno: Specialista
Time Online: 16 Days, 13:56:49 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Non c'è un solo motivo valido per cui in Java non dovrebbe essere così :P

Cmq...l'idea è :

Io sono la procedura InOrder :
ho figlio sx ?Vedo il figlio sx x ricorsione chiamandomi di nuovo
stampo l'elemento
ho figlio dx ?Vedo il figlio dx x ricorsione chiamandomi di nuovo

Se vuoi il maggiore devi cercare il nodo + a destra
Se vuoi il minore il nodo + a sinistra

__________________
Cristian,il Nous che invoglia ^_^

"La capa è troppo in la,e la sbarba è troppo giovane..mi sa che qua si va in bianco"
Ryo Saeba (City Hunter)

Last edited by nous on 21-10-2002 at 09:41

21-10-2002 09:37
Click Here to See the Profile for nous Click Here to See the Blog of nous Click here to Send nous a Private Message Visit nous's homepage! Find more posts by nous Add nous 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:15.    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.064 seconds (64.09% PHP - 35.91% MySQL) con 26 query.