The ACM ICPC competition is an annual competitive programming competition among universities of the world. Teams compete in regional contests to qualify for the World Finals. During that contests between 8 and 15 problems have to be solved in a time period usually around 5 hours. The problems covers a large range of topics in computer science.
During my studies of computer science I participated three times for the German team of the Karlsruher Institute of Technology on regional contests. In this repository you will find solved problems from various competitive programming resources and several basic algorithms. In contrast to other ICPC repositories on github I focus on readibility and understanding of the algorithms, while simultanously ensure that the implementations are short and easy to integrate into solutions of problems.
In this Section, I list several algorithms you can find in this repository with its links to the source code.
- Single Source Shortest Path (Dijkstra's Algorithm)
- Maximum Flow (Edmond-Karps Algorithm)
- Minimum Spanning Tree (Kruskal's and Jarnik-Prims Algorithm)
- Strongly Connected Components (Tarjan's Algorithm)
- Range Minimum Query
- Lowest Common Ancestor
- Generic Segment Tree
You can use this segment tree to implement all kinds of applications, which can be solved with this data structure without changing the implementation. In the source code I provide detailed examples how to implement e.g.:
a. Range Minimum Query
b. Range Maximum Query
c. Range Minmax Query
d. Interval Sum
e. Interval Product - 2D Range Search
Given a rectangle the data structure returns all points inside the rectangle. - 2D Range Maximum Query (K2Treap)
Given a rectangle the data structure returns the point with maximum weight inside the rectangle. - Fenwick Tree
Implements interval sum in O(1) with update functionallity in O(log(n))
- Longest Common Subsequence
Special Implementation which runs on random inputs in O(n*log(n)) time. - Longest Increasing Subsequence
Implementation returns longest increasing subsequence in O(n*log(n)) time.