Skip to content
LUDA · 學思辨行

LUDA · 學思辨行

Learn extensively, Understand deeply, Discern clearly, and Act resolutely.

  • About
  • Learning Path

Category: Sequences

How the Boyer-Moore vote finds a majority candidate

November 13, 2026By HoHo Zhao

Short answer: The Boyer-Moore majority vote finds a candidate that is the only value that could be a strict majority of an array, using one counter and one candidate. It scans once. On a match it increments. On a mismatch it decrements. At zero it takes the current value…

Algorithms, SequencesLeave a comment

How Floyd’s cycle algorithm meets a tortoise and a hare

November 13, 2026By HoHo Zhao

Short answer: Floyd’s cycle-finding algorithm detects a cycle in a sequence defined by x, f(x), f(f(x)), … with two pointers and no stored history. The tortoise advances one step and the hare two. If there is a cycle, they meet. The meeting point is then used to find the…

Algorithms, SequencesLeave a comment

How Brent’s cycle search resets on powers of two

November 13, 2026By HoHo Zhao

Short answer: Brent’s cycle algorithm finds a cycle in a sequence x, f(x), f(f(x)), … with constant memory. A hare walks alone. Whenever the distance since the last reset is a power of two, the tortoise jumps to the hare and the search length doubles. When the hare lands…

Algorithms, SequencesLeave a comment
  • Algorithms
  • Arithmetic
  • Authelia
  • Clustering
  • Coding
  • Compression
  • Cryptography
  • CSS
  • Distributed Systems
  • Docker
  • Dynamic Programming
  • Exact Algorithms
  • Games
  • Geometry
  • Grafana
  • Graphs
  • Greedy
  • Heaps
  • Homelab
  • IPsec
  • LDAP
  • Linear Algebra
  • Logging
  • Loki
  • nginx
  • Number Theory
  • Numerical
  • Optimization
  • Parsing
  • Prometheus
  • Randomization
  • Range Queries
  • Sampling
  • Scheduling
  • Search
  • Searching
  • Sequences
  • Sketches
  • Sorting
  • Streams
  • Strings
  • SVG
  • Synchronization
  • Systems
  • Transforms
  • Trees

Docker EAP-MSCHAPv2 FreeRADIUS Grafana gzip IKEv2 IPsec LogQL Loki OpenLDAP Promtail StrongSwan

© 2026 LUDA · 學思辨行. Powered by WordPress.