34/39
Part 7 of 7 · Follow-upsLearn

What if the list is too long for recursion?

Anything that recurses once per node, reversing, merging, copying, stops near 1,000 nodes in Python. Nothing stops an interviewer from handing you a longer list.

Predict

copy.deepcopy copies a linked list by recursing into each node's next. At about how many nodes did it first raise RecursionError?

Pick an answer above to see the rest