Balanced bracket sequences

2021 VietMX 0

1. Overview A balanced bracket sequence is a string consisting of only brackets, such that this sequence, when inserted certain numbers and mathematical operations, gives a valid […]

Stars and bars

2021 VietMX 0

Stars and bars is a mathematical technique for solving certain combinatorial problems. It occurs whenever you want to count the number of ways to group […]

Catalan Numbers

2021 VietMX 1

Catalan numbers is a number sequence, which is found useful in a number of combinatorial problems, often involving recursively-defined objects. This sequence was named after […]

Binomial Coefficients

2021 VietMX 2

1. Overview Binomial coefficients $\binom n k$ are the number of ways to select a set of $k$ elements from $n$ different elements without taking […]

Finding repetitions

2021 VietMX 0

Given a string $s$ of length $n$. A repetition is two occurrences of a string in a row. In other words a repetition can be described by […]

Expression parsing

2021 VietMX 0

A string containing a mathematical expression containing numbers and various operators is given. We have to compute the value of it in $O(n)$, where $n$ […]

Lyndon factorization

2021 VietMX 0

1. Lyndon factorization First let us define the notion of the Lyndon factorization. A string is called simple (or a Lyndon word), if it is strictly smaller than any […]

Suffix Automaton

2021 VietMX 0

A suffix automaton is a powerful data structure that allows solving many string-related problems. For example, you can search for all occurrences of one string in another, […]