Skip to content

Commit c9ddb02

Browse files
nshizirungudieumerci@gmail.comnshizirungudieumerci@gmail.com
authored andcommitted
added the listing tag and refrenced it in the paragraph above it
1 parent 3fd0c7c commit c9ddb02

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

source/ch7_recursion.ptx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,11 @@ public class ArrayProcessor {
298298
</p>
299299

300300
<p>
301-
The following Python code demonstrates a situation where a function calls itself indefinitely without a base case, leading to a <c>RecursionError</c> due to overflowing the call stack.
301+
The following Python code in <xref ref="python-recursion-error" text="type-global"/>demonstrates a situation where a function calls itself indefinitely without a base case, leading to a <c>RecursionError</c> due to overflowing the call stack.
302302
</p>
303-
<program xml:id="python-recursion-error" interactive="activecode" language="python">
304-
<code>
303+
<listing xml:id="python-recursion-error">
304+
<program interactive="activecode" language="python">
305+
<code>
305306
def cause_recursion_error():
306307
"""
307308
This function calls itself without a base case, guaranteeing an error.
@@ -317,6 +318,7 @@ public class ArrayProcessor {
317318
cause_recursion_error()
318319
</code>
319320
</program>
321+
</listing>
320322

321323
<p>
322324
The following Java code demonstrates a similar situation, where a method calls itself indefinitely without a base case, leading to a <c>StackOverflowError</c>.

0 commit comments

Comments
 (0)