Data Structures and Algorithms Practice

Introduction

This repository contains my solutions to algorithmic problems. Main language is C++

Topics included(Some problems may not be listed here):

  1. Basic Algorithms:

    • Sorting: kattis/sortofsorting(E), CF/1808B(M), USACO/786(M, time interval), LC/881, USACO/713, USACO/1251
    • Binary Search: VNOJ/nksgame(M), CF/1201C(M), USACO/666(E), CSES/1085(M) (similar to LC/1011), USACO/690(M), USACO/858(M), CF/424B, CSES/1620, HackerRank/minimum-loss, CF/1117C, VNOJ/ndccard, CF/283911A, CF/283911B, CF/283911C, CF/283911D, CF/283932A.cpp, CF/283932B
      • Minimax: CF/285083A, CF/285083B
      • Maximal Average: CF/285069A
      • Find the K-th Element: CF/285084A
    • Greedy: CSES/1090, CSES/1629(E), CF/1418C(M), CF/1338A(M), CSES/1630(M), kattis/doubleup, LC/948, LC/45, LC/134, USACO/1301, USACO/689
    • Complete Search: CF/863B, USACO/963(M), CF/574B, USACO/736
    • Backtracking: CSES/1623(E), CF/1097B(E), CSES/1622(M), LC/77, LC/51 (NQueens), USACO/1276
      • Permutaion: LC/46
    • Simulation: USACO/891, USACO/855
  2. Data Structures:

    • Stack: kattis/evenup(E), SPOJ/ONP(E)(transform algebraic expression into RPN)
    • Sets and Maps: CSES/1091(E, use multiset), USACO/964(E), USACO/687(M), USACO/831, CSES/1640, USACO/667, CSES/1163, CF/518B, LC/347, USACO/1107
    • Heap(PQ): USACO/690(M)
    • DSU: CSES/1676, LC/128, VNOJ/colquery, USACO/646, CF/104C, LC/305
    • Segment trees: CSES/1649, CSES/1648, CF/273169C, CF/380C, VNOJ/gss, VNOJ/qmax2
    • Fenwick trees: csa/swap_pairing
    • Indexed set: SPOJ/INVCNT
    • Sparse Table: CSES/1647
    • Sliding Window: LC/239, CSES/1141, CSES/2428
  3. Two pointers: VNOJ/nksgame(M), CSES/1090(E, Greedy, Sorting), LC/11, VNOJ/ndccard, VNOJ/sopenp, LC/56

  4. Graphs:

    • Graph Traversal: LQDOJ/4601(E), SPOJ/BCDAISY(E), VNOJ/nkguard(H), USACO/965(M), CSES/1666(E), CSES/1668(Bipartiteness check), USACO/668(E), USACO/574(M), USACO/944(E), kattis/birthday, LC/1319, vjudge/Gym-102433C, LC/994, LC/542
    • FloodFill: SPOJ/UCV2013H, SPOJ/BCLKCOUN, USACO/895
    • Shortest Path: CSES/1667, kattis/shortestpath3, CSES/1672, CF/295B, CSES/1671, USACO/969(min cost max flow), LC/743, SPOJ/MICEMAZE, SPOJ/TRAFFICN, CSES/1195, CSES/1193, CC/AUG18-REVERSE(0-1BFS)
    • MST: CSES/1675, kattis/cats, UVA/10397 (mst variants)
    • Graph Two Coloring: UVA/10004
    • Topo Sort: CSES/1679, LC/2115
    • Cycle Check: CSES/1678, DMOJ/acsl1p4, LC/207
  5. Dynamic Programming: CSES/1746(M), AC/dp_b(E), CF/1418C(M), CSES/1745(E), USACO/574(M), USACO/993(M), CSES/1093(E), USACO/694(M), VNOJ/nkrez(LIS variation)(E), VNOJ/nkcable(E), CSES/1639(E), LC/221, UVA/11450, UVA/507, LC/740(house robber variation), LC/983, UVA/108 (Kadane on 2D), kattis/commercials (Kadane on 1D), AC/dp_i, CSES/1145, UVA/10130, LC/714, AtCoder/dp_k, SPOJ/COINS, LC/313, CF/909C, LC/45

    • Bitmask DP: CSES/1690, VNOI/lem3, AC/dp_o
    • DP on DAG: CSES/1680
    • 0-1 Knapsack: LC/474
    • DP on string: LC/72
  6. String:

    • KMP:
    • Trie: SPOJ/ADAINDEX
  7. Prefix Sums: USACO/595(M), CSES/1662(similar to USACO/595), CSES/1619(M), CSES/1661(E), USACO/572, kattis/apivotalquestion, CF/909B, LC/253, LC/53 USACO/691

    • 2D pref: CSES/1652, USACO/1063
    • Divisibility of subarray: LC/974
  8. Bit Manipulations: CF/1097B(E), CF/550B(E, subsets), CF/1556D(H), HE/mattey-multiplication-6(E), AC/abc295_d(M)

    • Bit optimization:
  9. Tree Algorithms: CSES/1674, USACO/968, USACO/788

    • Tree diameter: CSES/1131, CSES/1132, CF/755C, LC/310
    • Euler Tour: CSES/1137
    • LCA: CSES/1688, CSES/1135
  10. Geometry: CF/100168L, CF/100168D, CF/100168F, CF/100168G, CF/100168I, CF/100168H, CSES/2191

  11. Math:

    • Divisibility: CSES/1713, LC/1492
    • Modular Arithmetic: CSES/1095, CSES/1712, UVA/10489
    • Combinatorics: CSES/1079
    • Primes: LC/204
    • Other: CF/515B, CF/909D
  12. Others:

    • Small to Large merging: CSES/1139
  13. Ad Hoc: USACO/832, USACO/915, USACO/894

  14. Rectangle Geometry: USACO/567, USACO/759

## STAT

* CodeChef : 1 
* CSES : 52 
* Codeforces : 40 
* Leetcode : 34 
* HackerEarth : 1 
* OJ.uz : 0 
* HackerRank : 1 
* SPOJ : 9 
* LQDOJ : 1 
* vjudge : 1 
* UVA : 7 
* USACO : 41 
* AtCoder : 7 
* csacademy : 1 
* Kattis : 13 
* Contest : 8 
* DMOJ : 1 
* VNOJ : 11 
* Total number of problems: 229