|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Junior Member
Iscritto dal: Jul 2011
Messaggi: 6
|
Vettori: Informatica aiuto?
mi potete aiutare a svolgere qst esercizio in pseudo codifica (era per le vacanze e non riesco a farlo):
IN PSEUDO CODIFICA Ricerca sequenziale in un vettore non ordinato: -RICSEQ(vett,dimen,elem) -->funzione che restituisce -1 se l' elemento non è trovato altrimenti l' indice del vettore in cui si trova l' elemento. aaaaaaaaaaaa non riesco a capire come is fa ![]() ![]() ![]() ![]() è giusot fare: Begin -for i=0 to i<dimen --if vett[i]==elem ---output i --else --output -1 End
__________________
||| "Punto... due punti! Ma sì, abbondiamo, adbondandis adbondandum." Ultima modifica di Minaz : 20-09-2011 alle 15:52. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: May 2001
Messaggi: 12795
|
A me sembra corretto
![]() Cos'è che non ti convince? |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Iscritto dal: Jul 2007
Città: Agliana (PT)
Messaggi: 560
|
Quote:
Codice:
Begin for i=0 to i<dimen { if vett[i]==elem { output i } } output -1 End
__________________
The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. In one Age, called the Third Age by some, an Age yet to come, an Age long past, a wind rose.... The wind was not the beginning. There are neither beginnings nor endings to the turning of the Wheel of time. But it was a beginning. |
|
![]() |
![]() |
![]() |
#4 |
Junior Member
Iscritto dal: Jul 2011
Messaggi: 6
|
ah ok, quindi è senza cicli o True e False
bene bene grazie ![]() ![]()
__________________
||| "Punto... due punti! Ma sì, abbondiamo, adbondandis adbondandum." |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Oct 2006
Città: milano
Messaggi: 1439
|
Macchè senza cicli
![]() |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 17:41.