Blogs

2021

Back to top ↑

2020

Sampling

5 minute read

1. Sampling Theory Sampling: takes discrete sample values from functions defined over continuous domains and then uses those samples to reconstruct new func...

Binary Lifting

4 minute read

Binary Lifting is a fabulous technique which can take $O(logn)$ time to find the lowest common ancestor (LCA) of two nodes in a tree, or to find the k-th anc...

C++ Notes: Tuple

1 minute read

I have known tuple​ of Python for a long time, but I just found that C++ also provides $tuple$. 1. The tuple​ Type A tuple is a template that is similar...

C++ Notes: Lambda Expressions

3 minute read

1. Introducing Lambda A lambda expression represents a callable unit of code. It is a convenient way of defining an anonymous function object (a closure) ri...

C++ Notes: Variables and Basic Types

8 minute read

1. Primitive Built-in Types [\text{primitive type} = \begin {cases} \text{arithmetic type} \begin {cases} \text{integral type (including character and bo...

KMP Algorithm

7 minute read

The Knuth–Morris–Pratt (KMP) algorithm is a string-searching algorithm. It can search for occurrences of a word within a main string by employing the observa...

Manacher’s Algorithm

5 minute read

Manacher’s Algorithm is an amazing algorithm to solve the problem of longest palindromic substring in $O(n)$ time. 1. Longest Palindromic substring Before ...

Back to top ↑