LCA – Lowest Common Ancestor
Errichto Algorithms
@errichtoAbout
Algorithms, competitive programming, coding interviews. I make educational videos and coding live streams, always sharing my thought process. My name is Kamil Dębowski (or Errichto) and I'm quite good at competitive programming. I'm a finalist of multiple big programming competitions like ICPC, Facebook Hacker Cup and Google Code Jam (even got 2nd place in 2018). I also organize competitions, which means inventing and preparing problems.
Latest Posts
Video Description
Tutorial on LCA algorithm. We use Binary Lifting to get O(N*log(N)) preprocessing and O(log(N)) to find the lowest common ancestor of two nodes in a tree. Binary Lifting video https://youtu.be/oib-XsjFa-M SPOJ problem https://www.spoj.com/problems/LCASQ/ code https://github.com/Errichto/youtube/blob/master/lca.cpp Two homework problems: 1) Answer queries "find distance between two given nodes U and V" https://cses.fi/problemset/task/1135 2) Given a tree with weighted edges (i.e. every edge has some value), answer queries "given two nodes U and V, find minimum weight along path U-V". (I don't have a source for this one). Coding live streams - https://www.twitch.tv/errichto FAQ - https://github.com/Errichto/youtube/wiki/FAQ Subscribe for more educational videos on algorithms, coding interviews and competitive programming.
Master Algorithms with These Essentials
AI-recommended products based on this video

How China Works: An Introduction to China’s State-led Economic Development

UGREEN Revodok Pro 210 Docking Station 10 in 1 USB C Dock Dual HDMI 4K@60Hz Single 8K@30Hz 100W PD 5Gbps USB C and USB A Data Ports Gigabit Ethernet, SD/TF Card Reader USB Hub Compatible for HP, Dell




