Université Lumière – Lyon 2, Faculté de Sciences Économiques et de Gestion DEUG 2ème année – Bloc 6 – Année 2000-2001 Informatique – Exercice d’algorithmique J. Darmont (http://eric.univ-lyon2.fr/~jdarmont/), 22/11/2000
À rendre le 21/11/00.
Écrire en langage algorithmique une procédure prenant en paramètres d’entrée : • un tableau d’entiers (on considérera qu’un type Tab adéquat a été déclaré), • la taille N de ce tableau, et affichant le contenu du tableau plus grand élément au plus petit. Exemple (N=5) : Contenu du tableau 123 4 45 205 68
Affichage 205 123 68 45 4
Correction Procédure Affiche_trié (t : Tab, n : entier) Var i, j, max, imax : entier Début Pour j := 1 à n faire max := -1 imax := -1 Pour i := 1 à n faire Si t(i)>max alors max := t(i) imax := i Fin si Fin pour Afficher(max) t(imax) := -1 Fin pour Fin
Principe de l’algorithme : Faire N fois (boucle 1) Initialiser une variable « maximum » à –1 et une variable « imax » à –1 Parcourir tout le tableau de l’indice 1 à l’indice N (boucle 2) Si l’élément courant est plus grand que le maximum Affecter la valeur de l’élément courant à la variable « maximum » Affecter l’indice courant du tableau à la variable « imax » Fin si Fin de parcours (boucle 2) Afficher la valeur de la variable « maximum » Remplacer l’élément du tableau d’indice « imax » par –1 pour éviter qu’il soit sélectionné à nouveau Fin de boucle 1
Vérification : Faites tourner votre algorithme « à la main » sur l’exemple présenté.
Question : Quel sera le contenu du tableau en sortie de procédure ?
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. grille de correction 1er cycle.pdf. grille de correction 1er cycle.pdf.
Nov 25, 2008 - be credited with performing research and analyzing data. The online version has been corrected. The corrected author and affiliation lines, and ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Exercice ...Missing:
that the polyhedron defined by the system b ⤠Ax ⤠c, l ⤠x ⤠u has. Chvátal rank at most t for all integral vectors b, c, l, u. Matrices with strong. Chvátal rank at ...
Nov 5, 2003 - sponding error correction data therebetWeen during a plural ity of time frames. ..... mobile sWitching center, or any communication device that can communicate .... data according to a cyclical redundancy check (CRC) algo rithm and ...
of feature classes in an image. There exist ... a certain class, a finer partitioning of the region can be ob- ..... Cambridge University Press, New York, NY, 1992.
Jun 11, 2007 - *Department of Physics, â Center for Biophysics and Computational .... and T.H. analyzed data; and I.C., B.O., C.J., and T.H. wrote the paper.
... can be continued in the space provided for. First and Middle Name. For example XYZ DATA CORPORATION (INDIA) PRIVATE LIMITED should be written as :.
www.nfirindia. GOVERNMEIVT OF INDIA. MII{I$TRY OF RATT,WAVfi. (RAIIWAY BO Dl. lvo. 2o13lH/5/1 {Folicy}- New Delhi, Dated:f 'o8'2o14'. General Managers ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Advance ...