0 views

Original Title: quiz1.pdf

Uploaded by PorkerriaCcdlv

- Nptel Week2 Module7 Quicksort
- 23slide.ppt
- Please Login to Submit Answers
- Lecture 1
- H06 Quiz1 Practice Sol
- Art of Programming Contest SE for Uva
- 05655365
- Sorting
- Data Structures and Algorithm Analysis in C++, Weiss, 3rd Edition. TABLE OF CONTENTS ONLY.
- 09 Buckets
- FRQs & MCQs- Sorting
- Searching and Sorting
- DSA (10-8-2012)
- test2fall98
- Ge8161 Python Programming Lab Record
- quiz section 6.docx
- Crisp Clusters
- C Programming
- 10 HashMap Etc
- More on Arrays

You are on page 1of 15

Professors Erik D. Demaine and Charles E. Leiserson Quiz 1

Quiz 1

� Do not open this quiz booklet until you are directed to do so. Read all the instructions on

this page.

� When the quiz begins, write your name on every page of this quiz booklet.

� This quiz contains 4 problems, some with multiple parts. You have 80 minutes to earn 80

points.

� This quiz booklet contains 13 pages, including this one. Two extra sheets of scratch paper

are attached. Please detach them before turning in your quiz at the end of the examination

period.

�

This quiz is closed book. You may use one handwritten A4 or

crib sheet. No

calculators or programmable devices are permitted.

� Write your solutions in the space provided. If you need more space, write on the back of the

sheet containing the problem. Do not put part of the answer to one problem on the back of

the sheet for another problem, since the pages may be separated for grading.

� Do not waste time and paper rederiving facts that we have studied. It is sufﬁcient to cite

known results.

� Do not spend too much time on any one problem. Read them all through ﬁrst, and attack

them in the order that allows you to make the most progress.

� Show your work, as partial credit will be given. You will be graded not only on the correct

ness of your answer, but also on the clarity with which you express it. Be neat.

� Good luck!

1 5 10

2 1 7

3 12 48

4 2 15

Total 80

Name:

6.046J/18.410J Quiz 1 Name 2

For each algorithm listed below,

� give a recurrence that describes its worst-case running time, and

� give its worst-case running time using � -notation.

6.046J/18.410J Quiz 1 Name 3

6.046J/18.410J Quiz 1 Name 4

Consider the recurrence

-notation.

Use the substitution method to give a tight upper bound on the solution to the recurrence using

6.046J/18.410J Quiz 1 Name 5

Circle T or F for each of the following statements to indicate whether the statement is true or

false, respectively. If the statement is correct, briefly state why. If the statement is wrong, explain

why. The more content you provide in your justification, the higher your grade, but be brief. Your

justification is worth more points than your true-or-false designation.

and

be asymptotically

nonnegative

T F Let functions.

Then, at least one relationship of

and must always hold.

T F The solution to the recurrence is .

6.046J/18.410J Quiz 1 Name 6

th Fibonacci number. Then, the

T F Let � denote the th Fibonacci number � can be

computed in time.

time

T F Suppose that an array

can be sorted in

contains numbers, each of which is

in the worst case.

, , or . Then, the array

6.046J/18.410J Quiz 1 Name 7

T F An adversary can provide randomized

quicksort with an input array of length that forces

the algorithm to run in � time on that input.

T F The array

forms a max-heap.

6.046J/18.410J Quiz 1 Name 8

T F Heapsort can be used as the auxiliary sorting routine in radix sort, because it operates in

place.

T F There exists a comparison sort of numbers that uses at most comparisons in the worst

case.

6.046J/18.410J Quiz 1 Name 9

table with collisions resolved by chaining contains items and has a

T F Suppose that a hash

load factor of �

simple uniform hashing, the expected time to search

. Assuming

for an item in the table is .

be an indicator random variable such that

T F Let . Then, we have

.

6.046J/18.410J Quiz 1 Name 10

T F Suppose that a hash table of slots contains a single element with key and the rest of

the slots are empty. Suppose further that we search times in the table for

various other

�

keys not equal to . Assuming simple uniform hashing, the probability is �that one of

the searches probes the slot containing the single element stored in the table.

T F Let be a set of integers. One can create a data structure

6.046J/18.410J Quiz 1 Name 11

�

[15 points] (2 parts)

Consider a set

close in

if

that is, if the distance between and is at most the average distance between consecutive numbers

�

(a) Explain brieﬂy why every set of distinct numbers contains a pair of close

elements.

� � �

�

(b) Suppose that we partition around a pivot element , organizing the result into

two subsets of : and

, there exists a pair

in ).

6.046J/18.410J Quiz 1 Name 13

(c) Describe an -time algorithm to ﬁnd a close pair of numbers in . Analyze your

SCRATCH PAPER — Please detach this page before handing in your exam.

SCRATCH PAPER — Please detach this page before handing in your exam.

- Nptel Week2 Module7 QuicksortUploaded byHappy
- 23slide.pptUploaded byQueenie Quach
- Please Login to Submit AnswersUploaded byKarthiek Bokka
- Lecture 1Uploaded byRakesh Kumar Nikhil
- H06 Quiz1 Practice SolUploaded byRamanakumar Palakodeti
- Art of Programming Contest SE for UvaUploaded bymarcelozeballos96
- 05655365Uploaded byAnh Hung
- SortingUploaded byddro
- Data Structures and Algorithm Analysis in C++, Weiss, 3rd Edition. TABLE OF CONTENTS ONLY.Uploaded byelunicopericodelospalotes
- 09 BucketsUploaded byMaulik S Hakani
- FRQs & MCQs- SortingUploaded byShiva Krishna
- Searching and SortingUploaded bySandeep9
- DSA (10-8-2012)Uploaded byHenryHai Nguyen
- test2fall98Uploaded byGobara Dhan
- Ge8161 Python Programming Lab RecordUploaded bythanammal indu
- quiz section 6.docxUploaded byMarija Nikolic Jokanovic
- Crisp ClustersUploaded byHiren Mistry
- C ProgrammingUploaded bybarsa
- 10 HashMap EtcUploaded byHannan Mumtaz
- More on ArraysUploaded byrangarajantr
- Final HashingUploaded bypoonam
- Hash TableUploaded byPaulina Elena Voicu
- 5.-Introduction-to-Data-Structures.pdfUploaded byKiruthika Munisamy
- Analysis of Algorithm Lecture BreakdownUploaded byHafiz Abdulwahab
- A Parallel Multiple Hashing Architecture for IP Address LookupUploaded bylaplaceiitkgp
- lec-16.pdfUploaded byAsseel Fleihan
- hsrtUploaded bycockdacrjjkl
- HashingUploaded byraven_86
- c codingUploaded byanurag_gdu
- Hash Cuckoo Esa2009Uploaded byanthony

- Samples OlUploaded byPorkerriaCcdlv
- ps2sol.pdfUploaded byPorkerriaCcdlv
- final.pdfUploaded byManoj Nanduri
- final.pdfUploaded byManoj Nanduri
- input2.txtUploaded byPorkerriaCcdlv
- input2.txtUploaded byPorkerriaCcdlv
- quiz2_solUploaded byPorkerriaCcdlv
- ps1Uploaded byAnonymous PDGLsjN1Q5
- prac_final_sol.pdfUploaded byPorkerriaCcdlv
- merge_sortedUploaded byipjeaanvbnr
- input3Uploaded byPorkerriaCcdlv
- tech-specs.txtUploaded byPorkerriaCcdlv
- Prac Final SolUploaded byPorkerriaCcdlv
- bits-cheat-cheet.pdfUploaded byPorkerriaCcdlv
- prac_final_sol.pdfUploaded byPorkerriaCcdlv
- error_F1V2_pag17_vol2.pdfUploaded byPorkerriaCcdlv
- Algo Merge2 TypedUploaded byManoj Mallakuntla
- Interview Prep for Junior QuantsUploaded byjjusufz
- reflexiones_2011Uploaded byPorkerriaCcdlv
- system-design.pdfUploaded byPorkerriaCcdlv
- Mc Graw Hill - Calculo Diferencial E Integral - Teoria Y 1175 Problemas ResueltosUploaded byapi-3753578
- Carta Inicio Del LaboratorioUploaded byPorkerriaCcdlv
- Indice General 293778606Uploaded byPorkerriaCcdlv
- Guia de Estudio de Funciones de Una Variable Real II-diciembre 2013Uploaded byPorkerriaCcdlv
- Suce SionesUploaded byPorkerriaCcdlv
- Serie de Potencias TeoriaUploaded byPorkerriaCcdlv
- Error F1V2 Pag17 Vol2Uploaded byPorkerriaCcdlv
- Aviso Pec 2013Uploaded byPorkerriaCcdlv
- LICENSE.txtUploaded bySergio Fuentes Navarro

- CommunityGuidel-PropertyFilterUploaded byshrihn
- AN249Uploaded byjuampic
- Intro to IB for End UsersUploaded bybobkadoo
- MQL4 Reference 2Uploaded byBucat
- r5410503 Data Warehousing and Data MiningUploaded byGireesh Kumar
- PPT_01Uploaded byAmit Yadav
- Arista 7280 Switch ArchitectureUploaded byMittal Makwana
- Mini Thermal Receipt PrinterUploaded bySandra Markiv
- M116C 1 EE116C-Midterm2-w15 SolutionUploaded bytinhtrilac
- MCA Question Papers - Microprocessor - UNOMUploaded byi2bruas
- Securing Extreme SwitchUploaded bySalman Alfarisi
- Unit Test1 %28autosaved%29[1]Uploaded bysurendrarakshit
- M_Turbo NAS_20091231_V3-2-0_ENGUploaded byNikita Zayakin
- 12 Create Packages(21)Uploaded byRASHMI_HR
- Divide And Conquer StrategyUploaded bySaraah Ghori
- In This Section ClipCursor This Function Confines the Cursor ToUploaded byzeolits
- 17080916135725286_5_5v200.pdfUploaded bytetrapoltest
- Sentinel Advance II ManualUploaded byMihai Horhoianu
- Design Implementation and Optimization QuartusUploaded byphithuc
- Computer and Its ComponentsUploaded byIsmail Msw
- Creative Configurations WhitepaperUploaded byTerence Kavanagh
- Engg 407 NotesUploaded byAmeet Rai
- pic pptUploaded byParamdeep Singh Bhatia
- Informatica FAQsUploaded bydddpanday
- wopedUploaded byRaulFer
- HuffmanUploaded bytejas
- Getting Started With Embedded Windows and WinKit LEUploaded bywz8g5h
- Int 881 Cyber Crime and Computer ForensicUploaded byतरुण भारत
- ooadUploaded by5zu
- StartC51Uploaded byapi-3724941