0% found this document useful (0 votes)
89 views19 pages

Essential Data Structures and Algorithms

Uploaded by

satwika3220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views19 pages

Essential Data Structures and Algorithms

Uploaded by

satwika3220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Important topics: Array, String, Trees, DFS/BFS, Recursions, Linked List, Math, Dynamic

Programming. Array, String, Trees, DFS/BFS, Recursions, Linked List, Math


DAY 1

Fast Input & Output

Speeding up I/O can make a substantial difference.

(Optional) C++ - Writing Generic Code

Writing code that can easily be reused or extended.

(Optional) C++ - Lambda Expressions

Defining anonymous function objects.

DAY 2

Time Complexity

Measuring the number of operations an algorithm performs.

Rectangle Geometry

Not Frequent

Problems involving rectangles whose sides are parallel to the


coordinate axes.

Introduction to Data Structures

Introduces the concept of a data structure, (dynamic) arrays,


pairs, tuples.
Simulation

Very Frequent

Directly simulating the problem statement, which many Bronze


problems allow you to do.

Basic Complete Search

Very Frequent

An easy example: iterating through all pairs.

Complete Search with Recursion

Rare

Includes generating subsets and permutations.

Introduction to Sorting

Not Frequent

Arranging collections in increasing order.

Introduction to Sets & Maps

Not Frequent

Maintaining collections of distinct elements/keys with sets and


maps.

Ad Hoc Problems
Rare

Problems that do not fall into standard categories with well-


studied solutions.

Introduction to Greedy Algorithms

Not Frequent

Selecting the choice that seems to be the best at the moment at


every step of your algorithm.

Introduction to Graphs

Somewhat Frequent

Visualizing problems as graphs with resources covering basic


terminology.

DAY 3

Introduction to Prefix Sums

Somewhat Frequent
Computing range sum queries in constant time over a fixed 1D
array.

More on Prefix Sums

Not Frequent
Max subarray sum, prefix sums in two dimensions, and a more
complicated example.

Custom Comparators and Coordinate Compression


Somewhat Frequent
Using a custom comparator to sort custom objects or values in a
non-default order; Coordinate compressing values from a large
range to a smaller one.

Two Pointers

Not Frequent
Iterating two monotonic pointers across an array to search for a
pair of indices satisfying some condition in linear time.
Updated: 3 weeks ago

More Operations on Sorted Sets

Not Frequent
Using iterators with sets, finding the next element smaller or
larger than a specified key in a set.

(Optional) C++ Sets with Custom Comparators

Rare
Incorporating custom comparators into standard library
containers.

Greedy Algorithms with Sorting

Somewhat Frequent
Solving greedy problems by sorting the input.

Binary Search

Somewhat Frequent
Binary searching on arbitrary monotonic functions and built-in
functions for binary search.
Depth First Search (DFS)

Very Frequent
Recursively traversing a graph.

Flood Fill

Somewhat Frequent
Finding connected components in a graph represented by a grid.

Introduction to Tree Algorithms

Rare
Introducing a special type of graph: trees.
Updated: Last month

(Optional) Introduction to Functional Graphs

Rare
Directed graphs in which every vertex has exactly one outgoing
edge.

DAY 4

Divisibility

Rare
Using the information that one integer evenly divides another.

Modular Arithmetic

Not Frequent
Working with remainders from division.
Introduction to DP

Very Frequent
Speeding up naive recursive solutions with memoization.

Knapsack DP

Not Frequent
Problems that can be modeled as filling a limited-size container
with a subset of items.

Paths on Grids

Not Frequent
Counting the number of "special" paths on a grid, and how some
string problems can be solved using grids.

Longest Increasing Subsequence

Has Not Appeared


Finding and using the longest increasing subsequence of an array.
Updated: Last week

Bitmask DP

Rare
DP problems that require iterating over subsets.

Range DP

Rare
Solving the problem on every contiguous subarray of the original
array.
Breadth First Search (BFS)

Not Frequent
Traversing a graph in a way such that vertices closer to the
starting vertex are processed first.

Disjoint Set Union

Somewhat Frequent
The Disjoint Set Union (DSU) data structure allows you to add
edges to an initially empty graph and test whether two vertices of
the graph are connected.

Topological Sort

Rare
An ordering of vertices in a directed acyclic graph that ensures
that a node is visited before every node it has a directed edge to.

Shortest Paths with Non-Negative Edge Weights

Somewhat Frequent
Introduces Bellman-Ford, Floyd-Warshall, Dijkstra.

Minimum Spanning Trees

Not Frequent
A subset of the edges of a connected, undirected, edge-weighted
graph that connects all the vertices to each other of minimum
total weight, where no cycles are allowed.
Stacks

Rare
A data structures that only allows insertion and deletion at one
end.

Sliding Window

Not Frequent
Maintaining data over consecutive subarrays.

Point Update Range Sum

Somewhat Frequent
Introduces Segment Tree, Binary Indexed Tree, and C++ Order
Statistic Tree.

Euler Tour Technique

Not Frequent
Flattening a tree into an array to easily query and update
subtrees.

DP on Trees - Introduction

Not Frequent
Using subtrees as subproblems.

DP on Trees - Solving For All Roots

Rare
Tree DP that uses the subtree from excluding each node's
subtree.
String Hashing

Rare
Quickly test equality of substrings with a small probability of
failure.
Updated: Last month

(Optional) More on Unordered Sets & Maps

Rare
Maintaining collections of distinct elements with hashing.

(Optional) A Faster Hash Table in C++

Rare
Introduces gp_hash_table.

Intro to Bitwise Operators

Has Not Appeared


Goes over the six bitwise operators and the common ways they
are used.

DAY 5

More Applications of Segment Tree

Somewhat Frequent
Walking on a Segment Tree, Non-Commutative Combiner
Functions
Range Queries with Sweep Line

Not Frequent
Solving 2D grid problems using 1D range queries.

Range Update Range Query

Rare
Lazy updates on segment trees and two binary indexed trees in
conjunction.

Sparse Segment Trees

Rare
Querying big ranges.

2D Range Queries

Rare
Extending Range Queries to 2D (and beyond).

Divide & Conquer - SRQ

Rare
Using Divide & Conquer to answer offline or online range queries
on a static array.

Square Root Decomposition

Rare
Splitting up data into smaller chunks to speed up processing.

Binary Jumping
Somewhat Frequent
Introduces the problems of finding level ancestors in a tree and
computing the lowest common ancestors.

Small-To-Large Merging

Rare
A way to merge two sets efficiently.

Heavy-Light Decomposition

Rare
Path and subtree updates and queries.

Centroid Decomposition

Rare
Decomposing a tree to facilitate path computations.

Geometry Primitives

Rare
Basic setup for geometry problems.

Sweep Line

Rare
Introduction to line sweep.
Updated: Last month

Convex Hull

Not Frequent
Smallest convex polygon containing a set of points on a grid.

Convex Hull Trick

Not Frequent
A way to find the maximum or minimum value of several convex
functions at given points.

Matrix Exponentiation

Rare
Repeatedly multiplying a square matrix by itself.

(Optional) Bitsets

Rare
Examples of how bitsets give some unintended solutions on
recent USACO problems.

Divide & Conquer - DP

Rare
Using Divide & Conquer as a DP Optimization.

DAY 6

Max Suffix Query with Insertions Only

Rare
A solution to USACO Gold - Springboards.

Wavelet Tree

Has Not Appeared


?

Counting Minimums with Segment Tree

Has Not Appeared


Querying for the minimum and number of occurences of minimum
in a range

Segment Tree Beats

Rare
Perform chmin and chmax range updates

Persistent Data Structures

Rare
What if data structures could time travel?

Treaps

Not Frequent
A randomized binary search tree

LineContainer

Rare
Convex Containers

Lagrangian Relaxation

Rare
aka Aliens Trick
Updated: 3 weeks ago
Slope Trick

Rare
Slope trick refers to a way to manipulate piecewise linear convex
functions. Includes a simple solution to USACO Landscaping.

Shortest Paths with Negative Edge Weights

Has Not Appeared


Returning to Bellman-Ford and Floyd-Warshall.

Eulerian Tours

Has Not Appeared


Visiting all edges of a graph exactly once.

BCCs and 2CCs

Rare

Strongly Connected Components

Rare
Subsets of nodes in directed graphs where each node in a subset
can reach each other node in the subset.

Offline Deletion

Has Not Appeared


Erasing from non-amortized insert-only data structures.

Euler's Formula
Rare
A formula for finding the number of faces in a planar graph.

Critical

Rare
CSES Critical Cities and Extensions

Link Cut Tree

Rare
Dynamic operations on a rooted forest

DP on Trees - Combining Subtrees

Rare
?

Additional DP Optimizations and Techniques

Rare
Techniques and optimizations like Knuth's optimization.
Updated: Last week

Sum over Subsets DP

Has Not Appeared


Taking bitmask DP to the next level.

Maximum Flow

Rare
Introduces maximum flow as well as flow with lower bounds.

Minimum Cut

Rare
?

Flow with Lower Bounds

Has Not Appeared


?

Minimum Cost Flow

Rare
Triangle Inequality, Johnson's Algorithm, and Min Cost Flow

Introduction to Fast Fourier Transform

Has Not Appeared


Quickly multiplying polynomials

More Complex Operations Using FFT

Has Not Appeared


?

String Searching

Rare
Knuth-Morris-Pratt and Z Algorithms (and a few more related
topics).

Suffix Array

Rare
Quickly Sorting Suffixes of a String (and Applications)

String Suffix Structures

Has Not Appeared


Suffix Automata, Suffix Trees, and Palindromic Trees

Extended Euclidean Algorithm

Rare
?

XOR Basis

Rare
?

Fracturing Search

Rare
A simple solution to "Robotic Cow Herd" that generalizes.

Game Theory

Has Not Appeared


?

Prefix Sums of Multiplicative Functions

Has Not Appeared


?

Matroid Intersection

Has Not Appeared


?

Interactive and Communication Problems

Rare
Some tips and tricks

Vectorization in C++

You might also like