I usually avoid learning algorithms. What ever language or database I’m using should be smart enough to be efficient. However, this article on Storing Hierarchical Data in a Database is very eye-opening. I’d never considered a “Modified Preorder Tree Traversal” before.