
Algorithmica
Algorithmica is an open-access web book dedicated to the art and science of computing. It is created by Sergey Slotin and the teachers and students of Tinkoff Generation — a nonprofit educational …
Algorithms Case Studies - Algorithmica
When you try to explain a complex concept, it is generally a good idea to give a very simple and minimal example illustrating it. This is why in this book you see about a dozen different ways of calculating …
Algorithms for Modern Hardware - Algorithmica
The articles hosted at ru.algorithmica.org/cs/ are not about advanced performance engineering but mostly about classical computer science algorithms — without discussing how to speed them up …
Cache Associativity - Algorithmica
Which one will be faster to finish? There are several considerations that come to mind: At first, you think that there shouldn’t be much difference, or maybe that the second loop is 257 256 \frac {257} {256} …
Instruction-Level Parallelism - Algorithmica
When programmers hear the word parallelism, they mostly think about multi-core parallelism, the practice of explicitly splitting a computation into semi-independent threads that work together to solve …
Segment Trees - Algorithmica
The lessons learned from optimizing binary search can be applied to a broad range of data structures. In this article, instead of trying to optimize something from the STL again, we focus on segment trees, …
Matrix Multiplication - Algorithmica
In this case study, we will design and implement several algorithms for matrix multiplication. We start with the naive “for-for-for” algorithm and incrementally improve it, eventually arriving at a version that …
Intrinsics and Vector Types - Algorithmica
Second, we need to include a header file that contains the subset of intrinsics we need. Similar to <bits/stdc++.h> in GCC, there is the <x86intrin.h> header that contains all of them, so we will just …
Prefix Sum with SIMD - Algorithmica
The prefix sum, also known as cumulative sum, inclusive scan, or simply scan, is a sequence of numbers b i bi generated from another sequence a i ai using the following rule: b 0 = a 0 b 1 = a 0 + …
Memory Bandwidth - Algorithmica
On the data path between the CPU registers and the RAM, there is a hierarchy of caches that exist to speed up access to frequently used data: the layers closer to the processor are faster but also …