#simd
SIMD Binary Search
SIMD Binary Search SIMD binary search accelerates binary search by evaluating multiple candidate comparisons in parallel. Instead of checking a single midpoint per step, the algorithm probes several positions using vector instructions and narrows the search range based on the combined results. The structure still follows binary search, but each iteration performs more comparisons per memory access. Problem Given a sorted array $A$ of length $n$ and a target value...
SIMD Linear Search
SIMD Linear Search SIMD linear search is a linear search variant that compares several values at the same time using vector instructions. SIMD means single instruction, multiple data. Instead of comparing one array element per loop iteration, the algorithm loads a block of elements into a vector register and compares all lanes against the target in one operation. The logical algorithm remains linear search. The speedup comes from processing multiple...
Vectorization
Array Vectorization Array vectorization processes multiple elements at once using wide CPU instructions. Instead of applying an operation to one value per instruction, the CPU applies it to a vector of values. You use it when arrays are large, element types are uniform, and the same operation applies to many consecutive elements. Problem Given arrays $A$ and $B$ of length $n$, compute an output array $C$ such that: $$ C[i]...