5 ms·
Or parsing. One of the most intuitive and elegant real-world uses of recursion. I've been writing an XML parser and everything is recursive. Of course, because
by delta_p_delta_x 3y ago
Or parsing. One of the most intuitive and elegant real-world uses of recursion. I've been writing an XML parser and everything is recursive. Of course, because XML is fundamentally a recursive data structure, a tree.
Who in their right mind would sincerely reach for a recursion to solve factorials or Fibonacci first?
Even the maths-minded people would write the sequence bottom-up, and stop when it reached their desired T(n); when programming it, they'd ask for a loop-esque construct that they could stop when a condition was reached.