Copyright © Rui-Jie Fang, 2018.
UVa Progress tracking: https://uhunt.onlinejudge.org/id/885236
A bunch of useful data structures are in the https://github.com/0x55553333/uva/tree/master/repo
folder:
Prime.c
- Sieve of Erastothenesbidirectional_bfs.cpp
- Bidirectional BFS implementation, not yet correctbit_array.cpp
- Scalable bitset implementation (supports growing/shrinking, like a vector of bits)circular_primes.c
- Circular primes sievedoubly_linked_array.cpp
- Array-based linked list implementation with O(1) query time for neighbor relationshipsequipartition.cpp
- Set partitioning problem using Horowitz-Sahni O(n 2^(n/2))-time algorithm for subset sumufd_generic.cpp
-- Generic union-find-disjoint sets; they support storing any type within a UFD-like structure for fast parent queryfloodfill_graph.cpp
- Convert adjacencies between 0s and 1s in mesh graph into a graphinterval_covering.cpp
- Greedy interval covering algorithmlis.cpp
- Longest Increasing Subsequence in O(n log n) time using patience sortingLIS1.cpp
- Longest Increasing Subsequence in O(n log n) time and O(n) space using the Young Tableau technique (Fredman 1975)LIS2.cpp
- Longest Increasing Subsequence in O(n^2) time and O(n) space using the Young Tableau technique (Fredman 1975, w/o binary search)min_seg_tree.cpp
- Plug-n-play Template Library implementation of generic segment tree for Range Minimum Query, supports single updates (todo: lazy range updates)primes.h
- HUGE header file containing a BUNCH of primessubset_sum.cpp
- The Horowitz-Sahni algorithm for subset-sumsum_seg_tree.cpp
- Plug-n-play Template Library implementation of generic segment tree for Range Sum Query, supports single updates (todo: lazy propagation)ufd.cpp
- Optimized union-find-disjoint set with path compression.bit.cpp
- Binary-indexed tree supporting generics.quadrangle.cpp
- Quadrangle Inequality speedup for Optimal BST problem based on UVa10304 (fully-recursive memoized implementation; better readability than the diagonal-by-diagonal iterative version).treap.cpp
- Treap in increasing order with order statistic functions. Rank/kth Not yet correct but treap is ready.wavelet1.cpp
- reference wavelet tree implementation with order statistic functionsdfs_grid.cpp
- Memoized DFS for finding MSSP on an input grid/mazebfs_grid.cpp
- BFS with path printing functionality for finding MSSP on an input grid/mazemaxflow.cpp
- Find max-flow using Edmonds-KarpMCMF.cpp
- find min-cost-max-flow using Edmonds-Karp + Bellman-Forddijkstra.cpp
- Dijkstra's algorithm for SSSPbellman_ford.cpp
- Bellman-Ford's algorithm for SSSP with negative weightsfw.cpp
- Floyd's algorithm for APSP and Warshall's algorithm for transitive closure Comments are in thecomments/
folder. All submissions are compiled with UVa's c++11 option.