Palindrome-Partitioning: Pixed line numbers in analysis of dynamic solution

This commit is contained in:
2025-09-21 18:47:07 -04:00
parent e3f82b9c3c
commit 040e551203

View File

@@ -9,9 +9,9 @@ Honor Code and Acknowledgments:
"""
# Analysis:
# The loop on line 23 iterates n times where n is the length of the input string.
# The loop on line 28 iterates n - i times, which despite being practically fewer
# steps on average than the line 23 loop, still scales linearly with the size of
# The loop on line 28 iterates n times where n is the length of the input string.
# The loop on line 32 iterates n - i times, which despite being practically fewer
# steps on average than the line 28 loop, still scales linearly with the size of
# the input string. Because both loops are O(n) and the second is nested in the
# first, the overall runtime complexity is O(n^2).