Sum of all elements of N-ary Tree
Sum of all elements of N-ary Tree sits in a file explorer. Farhan’s job is folder on disk. Write that first.
Sum of all elements of N-ary Tree on the board: left < root < right. Then say what folder on disk looks like after.
Without Sum of all elements of N-ary Tree, a file explorer gets messy and folder on disk is hard to trust.
Use Sum of all elements of N-ary Tree when folder on disk must stay clear. If a simpler DSA step works, use that instead.
If folder on disk breaks under Sum of all elements of N-ary Tree, check unbalanced BST becoming a list first.
After Sum of all elements of N-ary Tree, Farhan should still remember unbalanced BST becoming a list.
Close Sum of all elements of N-ary Tree with: “If I skip it, folder on disk goes wrong like this: unbalanced BST becoming a list.”
Board: folder on disk. Dry-run Sum of all elements of N-ary Tree. Name the trap: unbalanced BST becoming a list.