Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
2Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Algo Analysis

Algo Analysis

Ratings: (0)|Views: 46|Likes:
Published by bhaskarrao519

More info:

Published by: bhaskarrao519 on Jan 17, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

05/03/2014

pdf

text

original

 
Lecture Notes for Algorithm Analysis and Design
Sandeep Sen
1
November 15, 2009
1
Department of Computer Science and Engineering, IIT Delhi, New Delhi 110016, India.E-mail:
ssen@cse.iitd.ernet.in
 
Contents
1 Model and Analysis 3
1.1 Computing Fibonacci numbers . . . . . . . . . . . . . . . . . . . . . . 31.2 Fast Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Model of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 Other models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4.1 External memory model . . . . . . . . . . . . . . . . . . . . . 81.4.2 Parallel Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Warm up problems 11
2.1 Euclids algorithm for GCD . . . . . . . . . . . . . . . . . . . . . . . 112.1.1 Extended Euclids algorithm . . . . . . . . . . . . . . . . . . . 122.2 Finding the
k
-th element . . . . . . . . . . . . . . . . . . . . . . . . . 132.2.1 Choosing a random splitter . . . . . . . . . . . . . . . . . . . 142.2.2 Median of medians . . . . . . . . . . . . . . . . . . . . . . . . 152.3 Sorting words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.4 Mergeable heaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.4.1 Merging Binomial Heaps . . . . . . . . . . . . . . . . . . . . . 18
3 Optimization I :Brute force and Greedy strategy 20
3.1 Heuristic search approaches . . . . . . . . . . . . . . . . . . . . . . . 203.1.1 Game Trees * . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.2 A framework for Greedy Algorithms . . . . . . . . . . . . . . . . . . . 243.2.1 Maximal Spanning Tree . . . . . . . . . . . . . . . . . . . . . 263.2.2 A Scheduling Problem . . . . . . . . . . . . . . . . . . . . . . 273.3 Ecient data structures for MST algorithms . . . . . . . . . . . . . . 273.3.1 A simple data structure for union-nd . . . . . . . . . . . . . 283.3.2 A faster scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 293.3.3 The slowest growing function ? . . . . . . . . . . . . . . . . . 303.3.4 Putting things together . . . . . . . . . . . . . . . . . . . . . . 311
 
3.3.5 Path compression only . . . . . . . . . . . . . . . . . . . . . . 32
4 Optimization II :Dynamic Programming 33
4.1 A generic dynamic programming formulation . . . . . . . . . . . . . . 344.2 Illustrative examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.2.1 Context Free Parsing . . . . . . . . . . . . . . . . . . . . . . . 344.2.2 Longest monotonic subsequence . . . . . . . . . . . . . . . . . 354.2.3 Function approximation . . . . . . . . . . . . . . . . . . . . . 364.2.4 Viterbi’s algorithm for Expectation Maximization . . . . . . . 37
5 Searching 39
5.1 Skip Lists - a simple dictionary . . . . . . . . . . . . . . . . . . . . . 395.1.1 Construction of Skip-lists . . . . . . . . . . . . . . . . . . . . . 395.1.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405.2 Treaps : Randomized Search Trees . . . . . . . . . . . . . . . . . . . 425.3 Universal Hashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445.3.1 Example of a Universal Hash function . . . . . . . . . . . . . 455.4 Perfect Hash function . . . . . . . . . . . . . . . . . . . . . . . . . . . 465.4.1 Converting expected bound to worst case bound . . . . . . . . 475.5 A loglog
N
priority queue . . . . . . . . . . . . . . . . . . . . . . . . 47
6 Multidimensional Searching and Geometric algorithms 50
6.1 Interval Trees and Range Trees . . . . . . . . . . . . . . . . . . . . . 506.1.1 Two Dimensional Range Queries . . . . . . . . . . . . . . . . 516.2 k-d trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526.3 Priority Search Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . 546.4 Planar Convex Hull . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556.4.1 Jarvis March . . . . . . . . . . . . . . . . . . . . . . . . . . . 566.4.2 Grahams Scan . . . . . . . . . . . . . . . . . . . . . . . . . . 566.4.3 Sorting and Convex hulls . . . . . . . . . . . . . . . . . . . . . 576.5 A Quickhull Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 576.5.1 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586.5.2 Expected running time
. . . . . . . . . . . . . . . . . . . . . 606.6 Point location using persistent data structure . . . . . . . . . . . . . 61
7 Fast Fourier Transform and Applications 64
7.1 Polynomial evaluation and interpolation . . . . . . . . . . . . . . . . 647.2 Cooley-Tukey algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 657.3 The buttery network . . . . . . . . . . . . . . . . . . . . . . . . . . 672

Activity (2)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->