ompilers: CS31003
'
Computer Sc & Engg: IIT Kharagpur
$
1
Yacc/Bison
ect 8
&
Goutam Biswas
%
ompilers: CS31003
'
Computer Sc & Engg: IIT Kharagpur
$
2
Bison Yacc (yet another compiler-compiler) is a LALRa parser generator created by S. C Johnson. It is av
Algorithms II (CS31005)
Autumn 2011
1
Partha Bhowmick
CSE, IIT Kharagpur
Voronoi Diagram
Historically, the use of Voronoi diagrams can be traced back to
Descartes in 1644. Dirichlet used 2D and 3D Voronoi diagrams
in his study of quadratic forms in 1850.
Algorithms II (CS31005)
Autumn 2011
1
Partha Bhowmick
CSE, IIT Kharagpur
Line Segment Intersection
Given a set S = cfw_s1 , . . . , sn of line segments, the problem is to nd their points of intersection. We
should avoid testing pairs of segments lying fa
Algorithms II (CS31005)
Autumn 2011
1
Partha Bhowmick
CSE, IIT Kharagpur
Flow Networks
A ow network G = (V, E ) is a directed graph in which each edge (u, v ) E has a capacity c(u, v ) 0.
If (u, v ) E , then c(u, v ) = 0. Two special vertices, namely a so
Algorithms II (CS31005)
Autumn 2011
Partha Bhowmick
CSE, IIT Kharagpur
Dynamic Programming
If you optimize everything, you will always be unhappy.
Donald Knuth
1
Elements of Dynamic Programming
Optimal substructure: An optimal solution to the problem con
Algorithms II (CS31005)
Autumn 2011
Partha Bhowmick
CSE, IIT Kharagpur
Divide and Conquer
A divide-and-conquer algorithm recursively breaks down a problem into two or more sub-problems of the
same type, until they become simple enough to be solved directl
ompilers: CS31003
'
Computer Sc & Engg: IIT Kharagpur
$
1
Intermediate Representations
ect 10
&
Goutam Biswas
%
ompilers: CS31003
'
Computer Sc & Engg: IIT Kharagpur
$
2
Front End & Back End
The portion of the compiler that does scanning, parsing and stat
ompilers: CS31003
9
Computer Sc & Engg: IIT Kharagpur
6
1
Top-Down Parsing
ect 5
8
Goutam Biswas
7
ompilers: CS31003
9
Computer Sc & Engg: IIT Kharagpur
6
2
Non-terminal as a Function
In a top-down parser a non-terminal may be viewed as a procedure matchi
ompilers: CS31003
'
Computer Sc & Engg: IIT Kharagpur
$
1
LR Parsing
ect 7
&
Goutam Biswas
%
ompilers: CS31003
'
Computer Sc & Engg: IIT Kharagpur
$
2
LR(0) Parsing
An LR(0) parser can take shift-reduce decisions entirely on the basis of the states of LR(
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by Ca