Wednesday, October 30, 2013

Binary Trees and Football

Binary trees turn up in the most interesting places.



From the Daily Californian:

Kore Chan/Senior Staff, Daily Californian
On his dream: “I’d like to play football for the Pittsburgh Steelers.”
On playing offensive line: “Most people get lucky if they make five big decisions a day. We run 99 plays in a given game. It’s my job over the course of those 99 plays to call out a protection, call out a front and organize traffic. If I get that wrong, someone’s ribs gets broken, and someone goes to the hospital. For protections and calling out schemes, my track record is second to none. People call it pressure; I think it’s fun. You can think of your system algorithmically: If it’s a two by two with three down lineman, it’s this or this; if it’s three by one, you do this. Special case A, special case B. That’s what I think of when there’s eight men in the box. In my younger and more formidable years, I would say that (I suffered from paralysis by analysis.) Now, I actually think that thinking about it algorithmically like that makes it simpler. Most of time, it’s like a binary search tree: It’s either option A or option B. You go down a level: option A, option B. Whichever one it is, you make it and go.

Container ADTs and Sorting



Thursday, October 24, 2013

Testing Code

Students of EECS 280 often ask about the importance of testing code and catching problems early in the software engineering process (ideally at the time of creating requirements rather than at run-time).  A second popular question: is there partial credit for code that does not compile or pass certain test cases?  Here's an example of not getting partial credit for inadequate integration testing.

Graphic from the NYTimes article on a U.S. House Hearing on health insurance marketplaces.  Note the code in the lower left.

Wednesday, October 02, 2013