
Originariamente inviato da
signfra
for j6=1:length(vettore)
for j8=1:length(vettore2)
conta1(i)=j8;
end
if conta_inserimento==1
for k2=1:vettore3
for j=1:vettore4
conta2(j)=j;
end
end
end
if conta(1)==0
for k3=1:length(vettore4)
if conta2(1)==0
if carattere(k3)==carattere4
conta2(1)=1;
else
%richiamo la stessa funzione
funzione();
end
end
end
%chiusura primo ciclo for
Ora dovrebbe essere chiaro
salve vorre determinare il costo computazionale del seguente tipo di algoritmo:
function prova(A,vettore,vettore2,vettore3,vettore7,vettore8)
%Dato un ciclo for all'inizio
for i=1:length(vettore)
for i2=1:length(vettore2)
conta=1;
end
for i3=1:length(vettore3)
if A(2)==1
%istruzione
for i5=1:length(vettore7)
for i6=1:length(vettore8)
if A(i5)==9
conta=1;
end
if A(i6)==1
conta=2;
end
end
end
end
end
if A(2)==2
%eseguo di nuovo l'istruzione
prova(A,vettore,vettore2,vettore3,vettore7,vettore8)
end
end %chiusura for iniziale