I went to an interview today where I was asked to serialize a binary tree. I implemented an array-based approach where the children of node i (numbering in level-order trave
convert it to array with size of (2n + 1) each left son and right son will be in place of (2 * node number) and ((2 * node number) + 1 accordingly.
using https://www-inst.eecs.berkeley.edu//~cs61bl/r/cur/trees/array-repr.html?topic=lab20.topic&step=1&course=