Inorder Tree Traversal
11 18 2011 15:02

So I had an interview for an job yesterday. In fact, it was my first job interview. It went okay.

One of the technical questions the interviewer asked was to create a data structure that would insert in O(log n) and return an iterator that would iterate the data back in sorted order in O(n) time. I knew it was a binary tree and the iterator would use an inorder traversal of the tree so I started typing it out.

But when I got to the iterator part, I just couldn’t figure it out.  I knew for sure it was an inorder traversal but I couldn’t figure out how to turn the recursive algorithm that I knew into an iterative one. So I sat there and drew some trees to try and visualize the algorithm for it. I thought using a stack for the traversal would also probably work but I couldn’t figure that out either. And then time was up.

So we continued the interview. I asked some questions about the position. Then the interview ended.

I hung around for a little bit with a friend that worked there and referred me for the job then we biked back to our dorms. As soon as I got back I opened up Visual Studio and worked on the problem again because I knew that if I didn’t I’d probably end up staying up all night thinking about it.

It figured it out in ten minutes.

Coding under pressure, man. Can’t do it.


08 17 2011 23:14

I HATE MICROSTUTTERING.

TF2 Days
07 18 2011 21:25

Today I decided that, from now on, I am only allowed to play Team Fortress 2 on days that contain the letter “t”. So Tuesdays, Thursdays, and Saturdays are TF2 Days.

Hopefully this will encourage me to do something productive like… finishing all the other games in my Steam library.

Want.

GIRP
03 30 2011 02:35

I just completed GIRP in 23 minutes and 5.4 seconds and received a lump of coal.

I have never felt more accomplished.

If you haven’t played GIRP yet, play it now. A word of warning though:  the same guy who made QWOP, made GIRP.