Space cost of path copying in a persistent balanced BST

A persistent balanced BST never mutates a node: insert returns a new root, and every older root remains a valid, queryable version. It is implemented by path copying, where any node whose contents would change is copied instead of modified. Starting from a version holding n keys, m inserts (m ≤ n) are performed and every version is retained. How many nodes exist in total across all versions?

34 of 46 in Data Structures & Algorithms