Amazon interview question

Write a function to serialize a binary tree.

Interview Answer

Anonymous

Nov 13, 2011

I just stored the tree in an array with the index corresponding to its position in the tree.