Attribution Non-Commercial (BY-NC)

6 views

Attribution Non-Commercial (BY-NC)

- Teach Yourself Logic 2016
- ICS 2105 – DSA
- Cheat Sheet
- hwk1
- ECONOMIC GEOGRAPHY Vol. 55
- Conference.etet2015
- soi-solutions-1T
- COCOMO
- Sem 2 1213 Final Exam
- CSITY
- k-cnf-learnability
- 2012 02 15 Midsem Exam Schedule v2
- BMMKU
- MLD for linear MIMO channel.pdf
- Drdo Sample
- Power Rangers
- IST 2014
- Dynamic Programming examples
- DCME c09 Curriculum
- Intro to Advanced Applied Algorithms Nitk 2013

You are on page 1of 1

Problem Sheet 1

1. List the functions below from lowest order to highest order. If any two (or more) are of the same order,

indicate which.

n n − n3 + 7n5 n2 + lg n n3

2n lg

√n n2 (lg n)2

n lg n n 2n−1 n!

ln n en lg lg n n1+

n

X

3. Prove or disprove: i2 = θ(n2 ).

i=1

4. Prove the following. There are at most 2` nodes at level ` of a binary tree. A binary tree with depth

d has at most 2d+1 − 1 nodes. A binary tree with n nodes has depth at least blg nc.

5. Consider the following variant of Insertion Sort: for 2 ≤ i ≤ n, to insert the key L[i] among L[1] ≤

L[2] ≤ · · · ≤ L[i − 1], do a binary search to find the correct position for L[i].

• How many key comparisons would be done in the worst case? (using big-Oh.)

• What is the total number of times keys are moved in the worst case? (using big-Oh)

• What is the order of the worst case running time?

6. The first n cells of an array L of size N (much bigger than n) contain integers sorted in increasing

order. The remaining cells all contain some very large integer that we may think of as ∞. The array

may be arbitrarily large, and you don’t know n. Give an algorithm to find the position of a given

integer x < ∞ in the array in O(lg n) time.

7. We observed that a worst case for Insertion Sort occurs when the keys are initially in decreasing order.

Describe some other initial arrangements of the keys that are also worst cases.

8. Solve the following recurrences. Assume that T (1) = 1.

√ √

(b) T (n) = nT ( n) + n. (e) T (n) = 2T (n/2) + cn lg n.

(c) T (n) = T (n/2) + cn. (f) T (n) = 2T (n/2) + cn2 .

9. T (n) = T (n/3) + T (2n/3) + n; T (1) = 1. Show that T (n) is Ω(n lg n) using the recursion tree.

10. M is an n × n integer matrix in which the entries of each row are in increasing order (reading from

left to right) and the entries in each column are in increasing order (reading top to bottom). Give an

efficient algorithm to find the position of an integer x in M , or determine that x is not there. Say how

many (3-way) comparisons of x with matrix entries your algorithm does in the worst case. Is your

method optimal?

11. M is an n × m integer matrix. Suppose you sort each row of M in ascending order, and then sort each

column of M in ascending order. Show that after this the rows remain sorted.

- Teach Yourself Logic 2016Uploaded byAnonymous ji62REkBv
- ICS 2105 – DSAUploaded bySteve Ouma
- Cheat SheetUploaded byCmpt Cmpt
- hwk1Uploaded by007wasr
- ECONOMIC GEOGRAPHY Vol. 55Uploaded byDuke Alexandru
- Conference.etet2015Uploaded byAbhay Shankar Bharadwaj
- soi-solutions-1TUploaded byhydrogen93
- COCOMOUploaded byAiman Khizar
- Sem 2 1213 Final ExamUploaded byIskandar Bell
- CSITYUploaded byCS & IT
- k-cnf-learnabilityUploaded byEmpire Allies
- 2012 02 15 Midsem Exam Schedule v2Uploaded byVikram Garhwal
- BMMKUUploaded byNaresh Bopparathi
- MLD for linear MIMO channel.pdfUploaded byMuhammad Firdaus
- Drdo SampleUploaded byArghya Guha
- Power RangersUploaded byIzham Ismail
- IST 2014Uploaded byCS & IT
- Dynamic Programming examplesUploaded byCoeus Apollo
- DCME c09 CurriculumUploaded byAnonymous ZntoXci
- Intro to Advanced Applied Algorithms Nitk 2013Uploaded byDelenzy Cino
- New 7 Management ToolsUploaded byKaviArasu
- Lecture 1Uploaded bysanketsdive
- lectur-120121051527-phpapp01Uploaded byshemsedin shukre
- Ay1617 Scse Cs (25 April 2017)Uploaded byRyan M. Tan
- Sleeping Cell.pdfUploaded bykalutheace
- Quiz3-2017Uploaded bynorbihaver
- intake2018.pdfUploaded byk ashish
- BCA 403 (File & Data Structure).docxUploaded byneerukumari1
- hw2 questionsUploaded byapi-392597929
- UNIT_1[1]Uploaded bySri Devi

- Validated FIPS 140-1 and FIPS 140-2 Cryptographic ModulesUploaded bysrotenstein3114
- Catalyst 3750 Software Upgrade in a Stack Configuration With Use of the Command-Line Interface - CiscoUploaded byDhananjai Singh
- Recirculating Aquaculture Tank 2Uploaded byJared Yair
- bb_credit_recoveryUploaded byetchosts
- neplan0Uploaded bybajrica
- re10515_2005-10.pdfUploaded bySenon Subia
- Cswip Exam Question.pdfUploaded byAnonymous SA40GK6
- spru375eUploaded bySavita Prasad
- e_no.04-01Uploaded byErdinc Senman
- Life Cycle Cost for Systems and EquipmentUploaded byav8b
- MTG-3901,ACO-3901Uploaded byRtv Maastricht
- Stability Problems of Steel StructuresUploaded byĐào Hải Nam
- turbine blade coolingUploaded byVenkat
- Consumer Segments based on attitudes toward luxuryUploaded byLu Ce
- Renewable Energy SystemsUploaded bysrichander
- Mn Analysis MethodUploaded bysunnylele
- A Fourth Alternative in Interpreting Parmenides.pdfUploaded byChema Durón
- flow transmitter rosemount.pdfUploaded byjewd
- Astm D1250 Table 56Uploaded byFrankie Nguyen
- 3.4 Construction SpreadUploaded byanjangandak2932
- Nice MINE292 Laboratory ProcedureUploaded bybenrontol_20051786
- Automatic TransmissionUploaded byAnandraj004
- H2o MANAGEMENT USING PLC.pdfUploaded bydrbasit93
- HFSS TutorialsUploaded bytaanjit
- tmp18A.tmpUploaded byFrontiers
- 02 - Nc Details Nc400-Nc603Uploaded byDesepto Pranoto
- SelectivityUploaded byaggelisgeorge8546
- From Cajal to Conectome & BeyondUploaded byRich
- OK1Uploaded byDivya Krishnan
- Water Cooled Chillers PrimerUploaded byMuhammad Faizan Jantan