Skip to content

Commit 82168db

Browse files
committed
fixed a broken code
1 parent f46f5ef commit 82168db

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

source/ch7_recursion.ptx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def main():
238238
main()
239239
</code>
240240
</program>
241+
</listing>
241242

242243
<p><idx>separation of concerns</idx>
243244
The key insight here is called the <term>separation of concerns</term>. The public <c>sum_array</c> method provides a user-friendly interface—callers just pass an array and get the sum. Users don't need to know about indexes or how the recursion works internally. The private <c>_sum_helper</c> method handles the recursive logic with the extra parameter needed to track progress through the array.

0 commit comments

Comments
 (0)