Trust Your Geekflex

Blog Forum Gallery
« Encounter at Côte-Ste-Catherine · Orion (Poopie). 1997-2006. »

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:

Binary Tree Boat Race

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. :)

Tags: , , 4 comments

Comments

  1. Jim said:

    Well, it is nerdy but not as bad as Matt’s credit card

    I say change the rules a little. Have two teams, each one a binary tree. Just before you yell start you give them a traversal method to follow, the first team to finish using the proper traversal wins

  2. wilhelmtell said:

    ..and the closer you are to root, the higher the chances you win!

    Man I’d love to participate in a game! :)

  3. Jonathan said:

    Cool! Gotta try that. Amazing game and unintentional additional rule near the end:

    ”[…] the two people blow him […]”

  4. Jennifer said:

    I like this. I remember learning about binary trees in Operations Research and I think I would have remembered it better if we actually had a binary tree boat race like you suggested.

    …or then again, maybe not. but it would have been fun.

Leave a Response