34/38
Part 7 of 7 · Follow-upsLearn

To write a tree out and read it back, store each node's number of children in pre-order

A tree can be saved as one flat list and rebuilt from it.

Predict

A chain, A over B over C, and a fork, A over both B and C. Do their pre-orders differ?

Pick an answer above to see the rest
Predict

You write a chain 100,000 deep as nested JSON lists with json.dumps, then read it back with json.loads. What happens?

Pick an answer above to see the rest