Binary Tree Boat Race
Posted by Skrud at Friday, August 25th 2006 at 1:51pm
This idea came up while having a few pints at Les 3 Brasseurs last night, and then it steeped and elaborated and now it’s either absolutely brilliant, ridiculously nerdy, or both.
It’s a merger of a traditional Boat Race and the infamous Binary Tree data structure.
The Boat Race is a drinking game, in which two teams line up with a beer in front of each player, and start chugging. Like in a relay race, a person can’t start drinking until the player before him/her finishes. The first team to finish all their beers wins.
A Binary Tree is a way of organizing data. Each data is contained in a “node” and each node as at most two “children” which are below it in the tree. There is a “root” node, which is where the tree starts. It can have two “child nodes”, and each of those can have two child nodes, and so on. A node with no children is called a “leaf”. So at each level of the tree, you have at most double the number of nodes as the previously. Where n is the level if the tree, and the root is at n = 0, the maximum number of nodes at each level is 2n. A path through a binary tree is called traversal.
In the Binary Tree Boat Race, the players arrange themselves as a Binary Tree and start drinking in a parallel breadth-first pattern: The root starts drinking, and as soon as he finishes, the two people below him start drinking. As soon as they finish the people below them start drinking and so on. Here’s a diagram:

The winners of the Binary Tree Boat Race are all the members of the path leading from the root to the leaf node that finished drinking first. The root always wins. Following the diagram, if player F finishes drinking first, then the winners are the root, player B and player F.
Try it next Frosh. :)





