liste - index.pdf March 18, 2010 1 ITI 1521. Introduction `...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: index.pdf March 18, 2010 1 ITI 1521. Introduction ` a l’informatique II * Marcel Turcotte ´ Ecole d’ing´ enierie et de technologie de l’information Version du 18 mars 2010 R´ esum´ e – Listes chaˆ ın´ ees (partie 2) – Pointeur arri` ere – Listes doublement chaˆ ın´ ees – Noeud factice (dummy node) * . Ces notes de cours ont ´ et´ e con¸cues afin d’ˆ etre visualiser sur un ´ ecran d’ordinateur. Motd David Cummings, a programmer who worked on the Mars Pathfinder project, has written an interesting editorial in the L.A. Times encouraging Toyota to drop claims of software infallibility in their recent acceleration problems. He argues that embedded systems developers must program more defensively, and that companies should stop relying on software for safety. Quoting : ’If Toyota has indeed tested its software as thoroughly as it says without finding any bugs, my response is simple : Keep trying. Find new ways to instrument the software, and come up with more creative tests. The odds are that there are still bugs in the code, which may or may not be related to unintended acceleration. Until these bugs are identified, how can you be certain they are not related to sudden acceleration ? L.A. Times, 2010-03-11 Temps d’ex´ ecution Comparons l’efficacit´ e des impl´ ementations ` a base de tableaux ( ArrayList ) et ` a base de listes chaˆ ın´ ees ( LinkedList ) (toutes deux peuvent contenir un nombre illimit´ e d’objets, donc ArrayList utilise un tableau dynamique). Nous dirons que le temps d’ex´ ecution est variable (lent) si le nombre d’op´ erations varie selon le nombre d’´ el´ ements pr´ esentement sauvegard´ es dans la structure de donn´ ees, et constant (rapide) sinon. Temps d’ex´ ecution Pouvez-vous d´ ej` a pr´ edire laquelle des deux impl´ ementations sera la plus rapide ? ArrayList LinkedList void addFirst( E o ) variable constant void addLast( E o ) variable variable void add( E o, int pos ) variable variable E get( int pos ) constant variable void removeFirst() variable constant void removeLast() constant variable – Pour certaines op´ erations, lorsque l’une des impl´ ementations est rapide, l’autre est lente ; – En regardant le tableau ci-haut, quand devrait-on utiliser une impl´ ementation ` a base de tableaux ? Pour les acc` es directs (al´ eatoires) en lecture ; – Quand devrait-on utiliser une liste chaˆ ın´ ee ? Si tous les acc` es se font au d´ ebut de la liste ; – Quelle impl´ ementation consomme plus de m´ emoire ? Acc´ el´ erer addLast pour une liste simplement chaˆ ın´ ee Il y a une technique d’impl´ ementation simple permettant d’acc´ el´ erer l’ajout ` a l’arri` ere d’une liste chaˆ ın´ ee....
View Full Document

This note was uploaded on 06/07/2010 for the course CSI ITI1520 taught by Professor Marcelturcotte during the Spring '10 term at University of Ottawa.

Page1 / 8

liste - index.pdf March 18, 2010 1 ITI 1521. Introduction `...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online