Manacher longest palindromic substring: Examples & Code
Manacher longest palindromic substring: Reuse mirrored palindrome radii inside the rightmost known palindrome, expanding only when necessary. Return the…
Explore algorithm visualizations code snippets and tutorials
Manacher longest palindromic substring: Reuse mirrored palindrome radii inside the rightmost known palindrome, expanding only when necessary. Return the…
Binary search tree insertion, search and deletion: Build an unbalanced search tree, insert a key, search for a key, then delete a key using the inorder…
Lowest common ancestor (binary lifting): Precompute power-of-two ancestors, equalize query depths, then lift both vertices until their parents coincide.…
Modular inverse (extended Euclidean): Use Bézout coefficients to find x such that value × x ≡ 1 modulo modulus, when the GCD is one. Explore a worked example,…
Binary reflected Gray code: Map each binary index i to i XOR (i >> 1); adjacent codes differ by one bit. Explore a worked example, complexity and tested code.