Palindrome-Partitioning: Pixed line numbers in analysis of dynamic solution
This commit is contained in:
@@ -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).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user