Amazon interview question

Write a function to serialize a binary tree.

Interview Answer

Anonymous

13 Nov 2011

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