James Randall has a great post on AABBTree's with accompanying C++ code. The link was broken, the salvaged content along with code can be found here
https://burakbayramli.github.io/dersblog/sk/2025/04/aabb-randall.html