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 ?

DEUG 2ème année – Exercice d’Informatique (J. Darmont)

DEUG 2ème année – Exercice d’Informatique (J. Darmont)

exercice + correction d'algorithmique - université de Lyon2.pdf ...

Page 1 of 1. DEUG 2ème année – Exercice d'Informatique (J. Darmont). Université Lumière – Lyon 2, Faculté de Sciences Économiques et de Gestion.

16KB Sizes 0 Downloads 58 Views

Recommend Documents

grille de correction 1er cycle.pdf
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.

Correction
Nov 25, 2008 - Sophie Rutschmann, Faculty of Medicine, Imperial College. London ... 10550 North Torrey Pines Road, La Jolla, CA 92037; †Cancer and.

Correction
Jan 29, 2008 - Summary of empirical and computed Arrhenius parameters. SLO mutant. Experimental Arrhenius parameters. Calculated Arrhenius parameters ...

Correction
Nov 25, 2008 - be credited with performing research and analyzing data. The online version has been corrected. The corrected author and affiliation lines, and ...

Correction
Jan 29, 2008 - AH/AD. Ea(D). Ea(H), kcal/mol. AH/AD r0, Å. Gating, cm 1. WT. 2.1. 0.2‡. 0.9. 0.2‡. 18. 5‡. 1.0§. 15§ ... ‡Data from ref. 15. §Data from ref. 16.

EXERCICE Echelle Double.pdf
EXERCICE Echelle Double.pdf. EXERCICE Echelle Double.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying EXERCICE Echelle Double.pdf.

Correction
Correctionwww.pnas.org/content/early/2009/02/02/0811993106.short

www.espace-etudiant.net - correction TP 2eme lois de newton.pdf ...
Page 3 of 4. www.espace-etudiant.net - correction TP 2eme lois de newton.pdf. www.espace-etudiant.net - correction TP 2eme lois de newton.pdf. Open. Extract.

Exercice Electricite 2-09.pdf
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:

CORRECTION de l'examen de génétique 2017.pdf
l'inactivation de l'X qui donne la mosaïque cellulaire. IV et V voir le cours. Page 3 of 3. CORRECTION de l'examen de génétique 2017.pdf. CORRECTION de ...

universit`a degli studi di padova
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 ...

Dynamic forward error correction
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 ...

SI Correction Template - Legislation.gov.uk
renumbered as sub-paragraph (e). August 2016. PRINTED IN THE UNITED KINGDOM BY THE STATIONERY OFFICE LIMITED under the authority and ...

Single-Image Vignetting Correction
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.

Correction
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.

Correction DST_1G2.pdf
(c) Le coût marginal est égal au prix. (d) Aucune de ces 3 réponses. 2) Lorsque le coût moyen diminue avec la quantité produite, on dit que l'entreprise.

PAN CORRECTION FORM.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. PAN CORRECTION FORM.pdf. PAN CORRECTION FORM.pdf.

PAN Correction Form.pdf
... can be continued in the space provided for. First and Middle Name. For example XYZ DATA CORPORATION (INDIA) PRIVATE LIMITED should be written as :.

Advance correction slip.PDF
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 ...

Advance correction slip.PDF
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 ...

correction 2012.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.