Algorithms for the Real World

About the course:

This undergraduate course teaches the fundamentals of algorithms and problem solving (with proofs) together with their implementation in C++. Real-world applications of these algorithms are emphasized wherever possible.

Correctness proofs and complexity analysis are stressed together with efficient C++ implementation. The courses uses problems from UVa Online judge to supplement the algorithmic concepts learnt. The lecture notes and C++ code can be used for self-study for anybody interested in algorithms and programming. A basic background in discrete mathematics and programming is all that is needed. See ``Introduction" in the lecture notes below for more information.

Lecture Notes and C++ code:

Introduction

Prime number checking

Introduction to C++

IsPrime.cpp

FastIsPrime.cpp

Search

MySqrt.cpp

N-Queens.cpp

Programming-tips

Recursion

Recursion in C++

gcd.cpp

maxr.cpp

Sorting

simplesort.cpp

mergesort.cpp

quicksort.cpp

Randomized-quicksort.cpp

Sorting in C++

Data Structures and Hashing

pattern-match.cpp

pattern-match-from-file.cpp

Heap-Queue-Stack

Data Structures in C++

Data-Structures.cpp

Priority-Queue.cpp

hashtable.cpp

dictionary.cpp

Graph algorithms

Topological Sort and BFS

Greedy Algorithms

Dynamic Programming

Fibonacci-recursive.cpp

Fibonacci-table-lookup.cpp

fib-iter.cpp

UVa Programming Assignments and C++ code solutions

Factors and Factorials solution code

Ugly Numbers solution code

3n+1 Problem (Recursion and Table Lookup) solution code

Shellsort (A Sorting problem) solution code

Critical Links (Depth-First-Search) solution code

Playing with Wheels (Breadth-First-Search) solution code

Forwarding Emails solution code