IFT2015 A12 Examen Intra

Documents pareils
DOCUMENTATION - FRANCAIS... 2

Exercices sur SQL server 2000

DOCUMENTATION - FRANCAIS... 2

Instructions Mozilla Thunderbird Page 1

Application Form/ Formulaire de demande

Le passé composé. C'est le passé! Tout ça c'est du passé! That's the past! All that's in the past!

Once the installation is complete, you can delete the temporary Zip files..

Contents Windows

DOCUMENTATION MODULE BLOCKCATEGORIESCUSTOM Module crée par Prestacrea - Version : 2.0

Instructions pour mettre à jour un HFFv2 v1.x.yy v2.0.00

RULE 5 - SERVICE OF DOCUMENTS RÈGLE 5 SIGNIFICATION DE DOCUMENTS. Rule 5 / Règle 5

I. Programmation I. 1 Ecrire un programme en Scilab traduisant l organigramme montré ci-après (on pourra utiliser les annexes):

Utiliser une WebCam. Micro-ordinateurs, informations, idées, trucs et astuces

Gestion des prestations Volontaire

INVESTMENT REGULATIONS R In force October 1, RÈGLEMENT SUR LES INVESTISSEMENTS R En vigueur le 1 er octobre 2001

Technologies quantiques & information quantique

Practice Direction. Class Proceedings

Règlement sur le télémarketing et les centres d'appel. Call Centres Telemarketing Sales Regulation

Improving the breakdown of the Central Credit Register data by category of enterprises

Le No.1 de l économie d énergie pour patinoires.

calls.paris-neuroscience.fr Tutoriel pour Candidatures en ligne *** Online Applications Tutorial

MELTING POTES, LA SECTION INTERNATIONALE DU BELLASSO (Association étudiante de lʼensaparis-belleville) PRESENTE :

If you understand the roles nouns (and their accompanying baggage) play in a sentence...

Module Title: French 4

UML : Unified Modeling Language

Developing an alternative scenario in a case study for a single country. Mise en œuvre un scénario alternatif pour une étude de cas pour un seul pays

Compléter le formulaire «Demande de participation» et l envoyer aux bureaux de SGC* à l adresse suivante :

AMENDMENT TO BILL 32 AMENDEMENT AU PROJET DE LOI 32

English version Legal notice

XtremWeb-HEP Interconnecting jobs over DG. Virtualization over DG. Oleg Lodygensky Laboratoire de l Accélérateur Linéaire

WEB page builder and server for SCADA applications usable from a WEB navigator

Quel temps fait-il chez toi?

Paxton. ins Net2 desktop reader USB

Tammy: Something exceptional happened today. I met somebody legendary. Tex: Qui as-tu rencontré? Tex: Who did you meet?

Cours de didactique du français langue étrangère (*) French as a foreign language (*)

that the child(ren) was/were in need of protection under Part III of the Child and Family Services Act, and the court made an order on

Dans une agence de location immobilière...

APPENDIX 6 BONUS RING FORMAT

Logitech Tablet Keyboard for Windows 8, Windows RT and Android 3.0+ Setup Guide Guide d installation

France SMS+ MT Premium Description

3615 SELFIE. HOW-TO / GUIDE D'UTILISATION

CEST POUR MIEUX PLACER MES PDF

IDENTITÉ DE L ÉTUDIANT / APPLICANT INFORMATION

Stakeholder Feedback Form January 2013 Recirculation

LOI SUR LA RECONNAISSANCE DE L'ADOPTION SELON LES COUTUMES AUTOCHTONES ABORIGINAL CUSTOM ADOPTION RECOGNITION ACT

DOCUMENTATION - FRANCAIS... 2

Fiche produit ifinance v4

Principe de TrueCrypt. Créer un volume pour TrueCrypt

UNIVERSITE DE YAOUNDE II

FÉDÉRATION INTERNATIONALE DE NATATION Diving

THE SUBJUNCTIVE MOOD. Twenty-nineth lesson Vingt-neuvième leçon

Quick Start Guide This guide is intended to get you started with Rational ClearCase or Rational ClearCase MultiSite.

Cambridge International Examinations Cambridge International Advanced Subsidiary Level

MEMORANDUM POUR UNE DEMANDE DE BOURSE DE RECHERCHE DOCTORALE DE LA FONDATION MARTINE AUBLET

Editing and managing Systems engineering processes at Snecma

Archived Content. Contenu archivé

MEMORANDUM POUR UNE DEMANDE DE BOURSE DE RECHERCHE DOCTORALE DE LA FONDATION MARTINE AUBLET

Warning: Failure to follow these warnings could result in property damage, or personal injury.

physicien diplômé EPFZ originaire de France présentée acceptée sur proposition Thèse no. 7178

If the corporation is or intends to become a registered charity as defined in the Income Tax Act, a copy of these documents must be sent to:

English Q&A #1 Braille Services Requirement PPTC Q1. Would you like our proposal to be shipped or do you prefer an electronic submission?

Comprendre l impact de l utilisation des réseaux sociaux en entreprise SYNTHESE DES RESULTATS : EUROPE ET FRANCE

SCHOLARSHIP ANSTO FRENCH EMBASSY (SAFE) PROGRAM APPLICATION FORM

Formulaire de candidature pour les bourses de mobilité internationale niveau Master/ Application Form for International Master Scholarship Programme

Forthcoming Database

Contrôle d'accès Access control. Notice technique / Technical Manual

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Level

ONTARIO Court File Number. Form 17E: Trial Management Conference Brief. Date of trial management conference. Name of party filing this brief

PHOTO ROYAUME DE BELGIQUE /KINDOM OF BELGIUM /KONINKRIJK BELGIE. Données personnelles / personal data

ALGORITHMIQUE II NOTION DE COMPLEXITE. SMI AlgoII

Tex: The book of which I'm the author is an historical novel.

GAME CONTENTS CONTENU DU JEU OBJECT OF THE GAME BUT DU JEU

OBJECT PRONOUNS. French III

Règles et paramètres d'exploitation de Caparmor 2 au 11/12/2009. Pôle de Calcul Intensif pour la mer, 11 Decembre 2009

ETABLISSEMENT D ENSEIGNEMENT OU ORGANISME DE FORMATION / UNIVERSITY OR COLLEGE:

Notice Technique / Technical Manual

INDIVIDUALS AND LEGAL ENTITIES: If the dividends have not been paid yet, you may be eligible for the simplified procedure.

Sécurité relative aux sièges auto et aux rehausseurs

Garage Door Monitor Model 829LM

SERVEUR DÉDIÉ DOCUMENTATION

MANUEL MARKETING ET SURVIE PDF

UNIVERSITY OF MALTA FACULTY OF ARTS. French as Main Area in an ordinary Bachelor s Degree

Compte-rendu technique complet et détaillé des cookies

How to Login to Career Page

THE LAW SOCIETY OF UPPER CANADA BY-LAW 19 [HANDLING OF MONEY AND OTHER PROPERTY] MOTION TO BE MOVED AT THE MEETING OF CONVOCATION ON JANUARY 24, 2002

Cheque Holding Policy Disclosure (Banks) Regulations. Règlement sur la communication de la politique de retenue de chèques (banques) CONSOLIDATION

I>~I.J 4j1.bJ1UlJ ~..;W:i 1U

The new consumables catalogue from Medisoft is now updated. Please discover this full overview of all our consumables available to you.

DOSSIER DE CANDIDATURE APPLICATION FORM

Deadline(s): Assignment: in week 8 of block C Exam: in week 7 (oral exam) and in the exam week (written exam) of block D

lundi 3 août 2009 Choose your language What is Document Connection for Mac? Communautés Numériques L informatique à la portée du Grand Public

I. COORDONNÉES PERSONNELLES / PERSONAL DATA

Supervision et infrastructure - Accès aux applications JAVA. Document FAQ. Page: 1 / 9 Dernière mise à jour: 15/04/12 16:14

PRACTICE DIRECTION ON THE LENGTH OF BRIEFS AND MOTIONS ON APPEAL

Les techniques de la télémaintenance

Interest Rate for Customs Purposes Regulations. Règlement sur le taux d intérêt aux fins des douanes CONSOLIDATION CODIFICATION

POLICY: FREE MILK PROGRAM CODE: CS-4

Compte-rendu technique complet et détaillé des cookies

VTP. LAN Switching and Wireless Chapitre 4

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Advanced Subsidiary Level

Transcription:

IFT2015 A12 Examen Intra Miklós Csűrös 14 novembre 2012 English translation on the last three pages. Aucune documentation n est permise. L examen vaut 100 points. Vous pouvez avoir jusqu à 15 points de boni additionnels. Répondez à toutes les questions dans les cahiers d examen. F0 Votre nom (1 point Écrivez votre nom et code permanent sur tous les cahiers soumis. F1 Taux de croissance (20 points Remplissez le tableau suivant : chaque réponse vaut 2 points. Pour chaque paire f, g, écrivez = si Θ(f = Θ(g, si f = o(g, si g = o(f, et??? si aucun des trois cas n applique. Il n est pas nécessaire de justifier vos réponses. lg n dénote le logarithme binaire de n. f(n g(n a f(n = n 2 g(n = (2015n + 1 2 b f(n = lg n g(n = lg(n 2015 c f(n = n i=0 2i g(n = 2 n d f(n = n i=1 1/i g(n = ln n e f(n = n! g(n = (2n! f f(n = n 2015 g(n = (2n 2015 1 n = 0, 2, 4, 6, 8,... } g f(n = n g(n = n n = 1, 3, 5, 7, 9,... } h f(n = n ln n g(n = lg(n! i f(n = 4 n 1 n = 0} g(n = 4 g(n 1 n > 0} j f(n = 2 2n g(n = 4 n F1

F2 Polynômes (30 points On veut représenter des polynômes avec une seule variable par une liste chaînée. Pour un polynôme f(x = a 0 + a 1 x + a 2 x 2 + + a d x d, on utilise une liste avec (d + 1 nœuds. Le premier nœud stocke le coefficient a 0, le deuxième a 1, etc. 1 0 0 5 1 Liste représentant f(x = x 4 + 5x 3 + 1, un polynôme de degré 4. a. Degré du polynôme (15 points Le degré d un polynôme est l indice du dernier coefficient non-zéro (maxi: a i > 0}, ou 0 si a 0 = 0. Donnez un algorithme degree(n pour calculer le degré d un polynôme spécifié par la tête (nœud N contenant a 0 de sa liste. Notez que tout a i (même a d peut être 0. La liste vide (null représente f(x = 0. b. Évaluation (15 points Pour évaluer la valeur d un polynôme f(x à une x donnée, on utilise la règle Horner. On écrit ( (((ad f(x = a 0 +a 1 x+a 2 x 2 + +a d x d = x + a d 1 x + ad 2 x + + a 0 } } (d + 1 parèntheses imbriqués Par exemple, 2x 3 + x 2 x + 7 = ((2x + 1x 1x + 7. En général, l évaluation se fait par d multiplications et d additions : c est plus économique que l évaluation directe quand on calcule x, x 2,..., x d séparamment. Donnez un algorithme récursif eval(n, x pour évaluer un polynôme (tête à nœud N par la règle Horner. c. Addition de polynômes éparses (15 points boni Pour un polynôme éparse avec beaucoup de coefficients 0 (p.e., x 88 + 1, il vaut mieux stocker juste les termes non-zéro. Dans une telle implantation, chaque nœud contient un paire (a i, i de coefficient (a i et d exposant (i. Les nœuds sont dans un ordre strictement croissant de i. Donnez un algorithme pour calculer f(x + g(x quand f et g sont des polynômes. L algorithme prend les deux têtes de liste, et retourne la tête de la liste représentant le résultat. Par exemple, si f(x = x 88 + 1 (2 nœuds et g(x = 6x 2 x 1 (3 nœuds, alors f(x + g(x = x 88 + 6x 2 x comprend trois nœuds ( 1, 1, (6, 2, (1, 88, dans cet ordre. F2

F3 Θ o (14 points Soit f, g : 0, 1, 2... } (0, deux fonctions positives avec f(n = Θ (2 g(n. Démontrez que si lim n g(n =, alors lg f(n = ( 1 + o(1 g(n. F4 La médiane d un arbre (20 points d=2 h=2 Dans cet exercice, un nœud se dit médian si sa hauteur est égale à sa profondeur. Donnez un algorithme récursif qui affiche tous les nœuds médians dans un arbre binaire. L algorithme doit prendre un temps linéaire dans la taille de l abre. Indice: Passer la profondeur comme argument et retourner la hauteur. F5 Suppression dans le tas binaire (15 points Donnez un algorithme delete(h, i, n pour supprimer un élément dans un tas binaire H[1..n] par son indice i dans le tableau. (L argument n dénote le nombre d éléments : la capacité du tableau peut être plus grande que ça. L algorithme a le droit de réarranger les éléments dans le tableau, mais H[1..n 1] doit contenir la reste des éléments dans l ordre de tas après suppression. Montrez tous les détails de l algorithme. Indice: Pour i = 1, le déroulement est identique à deletemin ; autrement, il faut examiner le parent et les enfants de la case i et faire sink ou swim. BONNE CHANCE! F3

English translation No documentation is allowed. The examen is worth 100 points, and you can collect up to 15 additional bonus points. You may write your answers in English or in French. Answer each question in the exam booklet. E0 Your name (1 point Write your name and code permanent on each booklet that you submit. E1 Growth rates (20 points Fill out the following table : every answer is worth 2 points. For each pair f, g, write = if Θ(f = Θ(g, if f = o(g, if g = o(f, and??? if neither of the three applies. You do not need to justify the answers. lg n denotes the binary logarithm of n. f(n g(n a f(n = n 2 g(n = (2015n + 1 2 b f(n = lg n g(n = lg(n 2015 c f(n = n i=0 2i g(n = 2 n d f(n = n i=1 1/i g(n = ln n e f(n = n! g(n = (2n! f f(n = n 2015 g(n = (2n 2015 1 n = 0, 2, 4, 6, 8,... } g f(n = n g(n = n n = 1, 3, 5, 7, 9,... } h f(n = n ln n g(n = lg(n! i f(n = 4 n 1 n = 0} g(n = 4 g(n 1 n > 0} j f(n = 2 2n g(n = 4 n E1

E2 Polynomials (30 points We want to use a linked list to represent polynomials over a single variable. For a polynomial f(x = a 0 + a 1 x + a 2 x 2 + + a d x d, the list has (d + 1 nodes. The first node stores coefficient a 0, the second a 1, and so on. 1 0 0 5 1 List representing x 4 +5x 3 +1, a polynomial of degree 4. a. Degree (15 points. The degree of the polynomial is the largest power of the variable with non-zero coefficient (maxi: a i > 0}, or 0 if a 0 = 0. Give an algorithm degree(n that computes the degree of a polynomial stored in a list starting with node N (containing a 0 Note that any a i, including a d may be 0. The empty list (null corresponds to f(x = 0. b. Evaluation (15 points. One uses Horner s rule to evaluate a polynomial f(x at a given value x. Write ( (((ad f(x = a 0 +a 1 x+a 2 x 2 + +a d x d = x + a d 1 x + ad 2 x + + a 0 } } (d + 1 nested parentheses For instance, 2x 3 + x 2 x + 7 = ((2x + 1x 1x + 7. In general, the evaluation is done using d additions and d multiplications : this is faster than a naïve evaluation in which one computes x 1, x 2,..., x d separately. Give a recursive algorithm eval(n, x that evaluates a polynomial (constant term stored at the list head N by Horner s rule. c. Addition of sparse polynomial (15 bonus points For a sparse polynomial with many 0 coefficients (such as f(x = x 88 + 1, it is better to keep only the non-zero terms. One can use thus a linked list where the nodes store pairs (a i, i of non-zero coefficients a i and powers i. (The nodes are kept in a strict increasing order of powers i. Give an algorithm that computes f(x + g(x symbolically for two polynomials f, g. The algorithm takes the two list heads as arguments, and returns the head for the list storing the result. For instance, if f(x = x 88 + 1 (2 nodes and g(x = 6x 2 x 1 (3 nodes, the result f(x + g(x = x 88 + 6x 2 x consists of 3 nodes ( 1, 1, (6, 2, (1, 88. E2

E3 Θ o (14 points Let f, g : 0, 1, 2... } (0, be two positive functions with f(n = Θ (2 g(n. Show that if lim n g(n =, then lg f(n = ( 1 + o(1 g(n. E4 Median of a tree (20 points d=2 In this exercise, a node is called median, if its height equals its depth. h=2 Give a recursive algorithm that lists all the median nodes in a binary tree. The algorithm must take linear time in the tree size. Hint: Pass the depth as argument, and return the height. E5 Deletion in a binary heap (15 points Give an algorithm delete(h, i, n that deletes an element in a binary heap H[1..n] specified by its index i in the table. (The argument n denotes the number of elements in the heap : the table might have a larger capacicity than that. The algorithm may rearrange the elements in the table, but H[1..n 1] must contain the remaining elements after the deletion. Show all the details of the algorithm. Hint: For i = 1, the execution is identical to deletemin ; otherwise, inspect the parent and the children of cell i to decide between sink and swim. GOOD LUCK! E3