I was telling a friend on Thursday about how I spent my Valentine's Day, and the more I talked, the more I realized how truly nerdy I am. I had class until 10 p.m., so as soon as I got out, I ran home to dump my bags, and then headed to my S.O.'s (Significant Other because this shit is complicated) to watch the Day9. It was a friggin awesome daily if you haven't seen it, btw, though I actually don't remember any of the sc2 parts of it. When the daily finishes, we somehow manage to get talking about search trees, and we pull out the whiteboard to work on the following problem:
Given an arbitrary binary search tree, and two arbitrary nodes within the tree, what is the most efficient way to find the most common parent node of the two nodes?
Answer:
+ Show Spoiler +
Okay, so you don't know where these two nodes are on your tree, but you can find out the parent nodes. For each node, you want to count how many nodes lie between it and the root of the tree. Then you will be able to tell which one is further down the tree (or if they are equal distance). Once you have identified the lower node, you want to step up through its parent nodes until the two nodes are equal distance from the root. From there, you simply have to step both nodes up at the same time and check for equality between the two parent nodes you get.
This takes us a little while, because we think of other, less efficient methods first. Once we have solved it, we switch to a Haskell program my S.O.'s in the midst of writing. After about two or three hours of this (yeah it's pretty late, but we are night owls), we obtain an illicit copy of the old Tron, and fall asleep watching that.
At the time, this seemed perfectly normal. It wasn't anything particularly special, it's just how most of our evenings tend to go. However, as I am telling my friend about this, I am realizing more and more just how... abnormal this Valentine's Day was. I wonder if anyone else can relate to such things, or if I'm actually just weird.