These are the solutions I wrote for the 2016 Berkeley Programming Contest where I placed second. The algorithms used in the solutions are more interesting than the code itself. Here's a short comment on each problem:
- Graph Theory: finding number of paths in a DAG.
- Graph Theory: finding shortest distance on a weighted graph.
- Discrete Mathematics: (I didn't solve this problem.)
- Dynamic Programming: standard dynamic program problem.
- Computational Geometry: ray tracing / polygon-in-point.
- Data Structures: binary trees.
- Discrete Mathematics: binary search.
- Discrete Mathematics: a textbook interview problem about textbooks.
- Graph Theory: BFS, with some cleverness involved to keep track of Oski.