Posts
Heap Simple Implementation
· โ 2 min read · ๐ฆ Kyle
max_heap: A[0] is the maximum value
min_heap: A[0] is the minimum value
source code: AC/Algorithms/Heap
Hugo, Deploy With Github Actions
· โ 2 min read · ๐ฆ Kyle
I used to think deploying my blog with github actions is unnecessary, but now… (็้ฆ)
Deploying with github actions is so much faster.
Understand RSA, a Top Dwon Approach
· โ 2 min read · ๐ฆ Kyle
My simple note on the RSA algorithm.
Binary Indexed Tree, or Fenwick Tree
· โ 2 min read · ๐ฆ Kyle
BIT can be used to compute the prefix sum of an array in $log(n)$ time and takes only $O(n)$ space.
Matrix Fast Pow
· โ 5 min read · ๐ฆ Kyle
Use matrix and fast pow together can make some problems much easier.
Knapsack Problems
· โ 3 min read · ๐ฆ Kyle
knapsack problem and its variations
Ncurses Note
· โ 2 min read · ๐ฆ Kyle
The Curses library forms a wrapper over working with raw terminal codes, and provides highly flexible and efficient API (Application Programming Interface). It provides functions to move the cursor, create windows, produce colors, play with mouse etc. The application programs need not worry about the underlying terminal capabilities
Union Find
· โ 3 min read · ๐ฆ Kyle
Description from wiki: a disjoint-set data structure, also called a unionโfind data structure or mergeโfind set, is a data structure that stores a collection of disjoint (non-overlapping) sets
you can easily solve leetcode: 547. Number of Provinces w/ UF.
get UF template at github/sky-bro/AC/Algorithms/Union Find
Compile and Use Your Own Glibc
· โ 2 min read · ๐ฆ Kyle
Easily compile and use multiple glibc on a single machine.
Writing Guide
· โ 3 min read · ๐ฆ Kyle
Wargames Bandit
· โ 1 min read · ๐ฆ Kyle
De Bruijn Sequence
· โ 4 min read · ๐ฆ Kyle
A de Bruijn sequence of order n on a size-k alphabet A is a cyclic sequence in which every possible length-n string on A occurs exactly once as a substring.
For a de Bruijn sequence of order n on a size-k alphabet $A$, we denote it by $B(k, n)$
cin & cout is slow?
· โ 3 min read · ๐ฆ Kyle
Segment Tree (Iterative)
· โ 4 min read · ๐ฆ Kyle
A segment tree is a binary tree where each node represents an interval. Each node stores some property of its corresponding interval: like the maximum/minimum num, the sum of that interval.