79583607

Date: 2025-04-20 17:53:43
Score: 1
Natty:
Report link

Recursion can be a bit difficult to understand at first. This visualization shows how mergesort([3,2,7,1,4,6,5]) repeatedly splits the problem into sub-problems until a sub-problem is sorted, and then recombines the result of two sub-problems using merge() before it returns:

call tree

The final result is:

final image

Visualization made using invocation-tree, I'm the developer. (remove this line if considered self promotion)

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: bterwijn