I guess it's also worth noting that this could be done just as easily with a two dimensional array, haha.
You could cut down on the space usage a bunch if you used buckets for the nodes in the hash table, but it would increase the running time a bit (it'd still be O(n), though).