Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more ➡
Standard view
Full view
of .
×
P. 1
TCTutorial

TCTutorial

Ratings:

4.83

(6)
|Views: 14,539|Likes:
Tutorial for TopCoders
Tutorial for TopCoders

Availability:

See More
See less

03/18/2014

pdf

text

original

i
[TopCoder]
Algorithm Tutorials

A compilation
Nguyen Quang Huy
Nanyang Technological University, Singapore
December 2006

ii
To date, the following articles have been included:
Author

Title

lbackstrom

The Importance of Algorithms

antimatter

How To Dissect a TopCoder Problem Statement

Dumitru

How to Find a Solution

Planning an Approach to a TopCoder Problem:
-
Section 1
-
Section 2

Mathematics for TopCoders

lbackstrom

Geometry Concepts:
-
Section 1: Basic Concepts
-
Section 2: Line Intersection and its Applications
-
Section 3: Using Geometry in TopCoder Problems

Introduction to Graphs and Their Data Structures:
-
Section 1: Recognizing and Representing a Graph
-
Section 2: Searching a Graph
-
Section 3: Finding the Best Path through a Graph

supernova

Greedy is Good

Dumitru

Dynamic Programming:

misof

Computational Complexity-Section 1 -Section 2

Dan[Popovici]
&
mariusmuja

Using Regular Expressions

supernova

Understanding Probabilities

timmac

Data Structures

cucu

New Features of Java 1.5

timmac

Sorting

_efer_

Maximum Flow-Section 1 -Section 2

misof

Representation of Integers and Reals-Section 1 -Section 2

lovro

Binary Search

bmerry

A bit of fun: fun with bits

danielp

Range Minimum Query and Lowest Common Ancestor

iii
Links to original articles..................................................................................................................iiTable of contents............................................................................................................................iiiPreface...........................................................................................................................................ivThe Importance of Algorithms.........................................................................................................1How To Dissect a TopCoder Problem Statement.............................................................................5How To Find a Solution..................................................................................................................8Introduction.............................................................................................................................8Straight-forward problems that don't require any special technique(e.g. simulation, searching,sorting etc.)..............................................................................................................................8Breadth First Search (BFS)......................................................................................................8Flood Fill.................................................................................................................................9Brute Force and Backtracking................................................................................................10Dynamic Programming..........................................................................................................11Hard Drills:...........................................................................................................................12Linear Programming (Simplex).............................................................................................13Conclusion............................................................................................................................13Planning an Approach to a TopCoder Problem (Part I)..................................................................14Planning an Approach to a TopCoder Problem (Part II).................................................................17Mathematics for TopCoders..........................................................................................................21Geometry Concepts: Basic Concepts.............................................................................................27Geometry Concepts: Line Intersection and its Applications...........................................................31Geometry Concepts: Using Geometry in TopCoder Problems.......................................................35Introduction to graphs and their data structures: Section 1.............................................................38Introduction to graphs and their data structures: Section 2.............................................................42Introduction to graphs and their data structures: Section 3.............................................................48Greedy is Good.............................................................................................................................52Dynamic Programming: From novice to advanced........................................................................62Introduction (Beginner).........................................................................................................62Elementary............................................................................................................................63Intermediate..........................................................................................................................64Upper-Intermediate................................................................................................................65Advanced..............................................................................................................................66Computational Complexity: Section 1...........................................................................................67Computational Complexity: Section 2...........................................................................................73Using Regular Expressions............................................................................................................82Understanding Probabilities...........................................................................................................87Data Structures..............................................................................................................................94New Features of Java 1.5.............................................................................................................100Sorting........................................................................................................................................115Maximum Flow (Part I)...............................................................................................................120Maximum Flow (Part II).............................................................................................................126Representation of Integers and Reals (Part I)...............................................................................135Representation of Integers and Reals (Part II)..............................................................................140Binary Search..............................................................................................................................146A bit of fun: fun with bits ..........................................................................................................153Range Minimum Query and Lowest Common Ancestor ............................................................157