Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
51Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Algorithm Lectures

Algorithm Lectures

Ratings: (0)|Views: 729|Likes:
Published by ashodhiya14

More info:

Published by: ashodhiya14 on Aug 30, 2009
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

04/07/2013

pdf

text

original

 
Lecture Notes for Algorithm Analysis and Design
Sandeep Sen
1
March 16, 2008
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 6
1.1 Computing Fibonacci numbers . . . . . . . . . . . . . . . . . . . . . . 61.2 Fast Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.3 Model of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . 101.4 Other models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.4.1 External memory model . . . . . . . . . . . . . . . . . . . . . 111.4.2 Parallel Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Warm up problems 14
2.1 Euclids algorithm for GCD . . . . . . . . . . . . . . . . . . . . . . . 142.1.1 Extended Euclids algorithm . . . . . . . . . . . . . . . . . . . 152.2 Finding the
k
-th element . . . . . . . . . . . . . . . . . . . . . . . . . 162.2.1 Choosing a random splitter . . . . . . . . . . . . . . . . . . . 172.2.2 Median of medians . . . . . . . . . . . . . . . . . . . . . . . . 182.3 Sorting words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4 Mergeable heaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.4.1 Merging Binomial Heaps . . . . . . . . . . . . . . . . . . . . . 21
3 Optimization I :Brute force and Greedy strategy 22
3.1 Heuristic search approaches . . . . . . . . . . . . . . . . . . . . . . . 223.1.1 Game Trees * . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2 A framework for Greedy Algorithms . . . . . . . . . . . . . . . . . . . 263.2.1 Maximal Spanning Tree . . . . . . . . . . . . . . . . . . . . . 283.2.2 A Scheduling Problem . . . . . . . . . . . . . . . . . . . . . . 293.3 Efficient data structures for MST algorithms . . . . . . . . . . . . . . 293.3.1 A simple data structure for union-nd . . . . . . . . . . . . . 303.3.2 A faster scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.3 The slowest growing function ? . . . . . . . . . . . . . . . . . 323.3.4 Putting things together . . . . . . . . . . . . . . . . . . . . . . 331
 
3.3.5 Path compression only . . . . . . . . . . . . . . . . . . . . . . 34
4 Optimization II :Dynamic Programming 35
4.1 A generic dynamic programming formulation . . . . . . . . . . . . . . 364.2 Illustrative examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.2.1 Context Free Parsing . . . . . . . . . . . . . . . . . . . . . . . 364.2.2 Longest monotonic subsequence . . . . . . . . . . . . . . . . . 374.2.3 Function approximation . . . . . . . . . . . . . . . . . . . . . 384.2.4 Viterbi’s algorithm for Expectation Maximization . . . . . . . 39
5 Searching 41
5.1 Skip Lists - a simple dictionary . . . . . . . . . . . . . . . . . . . . . 415.1.1 Construction of Skip-lists . . . . . . . . . . . . . . . . . . . . . 415.1.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425.2 Treaps : Randomized Search Trees . . . . . . . . . . . . . . . . . . . 445.3 Universal Hashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465.3.1 Example of a Universal Hash function . . . . . . . . . . . . . 475.4 Perfect Hash function . . . . . . . . . . . . . . . . . . . . . . . . . . . 485.4.1 Converting expected bound to worst case bound . . . . . . . . 495.5 A loglog
N
priority queue . . . . . . . . . . . . . . . . . . . . . . . . 49
6 Multidimensional Searching and Geometric algorithms 51
6.1 Interval Trees and Range Trees . . . . . . . . . . . . . . . . . . . . . 516.1.1 Two Dimensional Range Queries . . . . . . . . . . . . . . . . 526.2 k-d trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536.3 Priority Search Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . 556.4 Planar Convex Hull . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566.4.1 Jarvis March . . . . . . . . . . . . . . . . . . . . . . . . . . . 576.4.2 Grahams Scan . . . . . . . . . . . . . . . . . . . . . . . . . . 576.4.3 Sorting and Convex hulls . . . . . . . . . . . . . . . . . . . . . 576.5 A Quickhull Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 586.5.1 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596.5.2 Expected running time
. . . . . . . . . . . . . . . . . . . . . 616.6 Point location using persistent data structure . . . . . . . . . . . . . 62
7 Fast Fourier Transform and Applications 65
7.1 Polynomial evaluation and interpolation . . . . . . . . . . . . . . . . 657.2 Cooley-Tukey algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 667.3 The buttery network . . . . . . . . . . . . . . . . . . . . . . . . . . 682

Activity (51)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
ibust liked this
Anita Ray liked this
dave_765 liked this
Mohamad Abdallah liked this
Muhammad Raheel liked this
Ajay Shinde liked this
jnturaj liked this

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)//-->