You have learned binary lifting for LCA.
But there are other ways to solve LCA: Euler tour + RMQ, Tarjan's offline algorithm, heavy-light decomposition. In the next section, I'll show you these alternative approaches. Some are faster to code, some handle dynamic trees, some answer queries in . Binary lifting is a great starting point, but the LCA problem has more tricks to offer. Each method has different trade-offs in preprocessing time, query time, and code complexity.