Pergunta de entrevista da empresa Couchbase

Another question was an interesting pseudocode question about a particular hybrid linked-list/tree data-structure. First, a direct request to write pseudocode (or whichever language is preferred) to flatten the structure into a "normal" linked list, and then a follow-up question about options to retain the non-flattened structure at the same time.