Skip to content

Commit e01cf42

Browse files
Comments reviewed
1 parent 628f184 commit e01cf42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: dynamic_programming/longest_increasing_subsequence.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def longestSub(ARRAY): #This function is recursive
1616
#Else
1717
PIVOT=ARRAY[0]
1818
LONGEST_SUB=[] #This array will contains the longest increasing sub array
19-
for i in range(1,ARRAY_LENGTH):
20-
if (ARRAY[i] < PIVOT): #For each element from the array (except the pivot), if the element is smaller than the pivot, it won't figure on the sub array that contains the pivot
19+
for i in range(1,ARRAY_LENGTH): #For each element from the array (except the pivot),
20+
if (ARRAY[i] < PIVOT): #if the element is smaller than the pivot, it won't figure on the sub array that contains the pivot
2121
TEMPORARY_ARRAY = [ element for element in ARRAY[i:] if element >= ARRAY[i] ] #But it cas figure in an increasing sub array starting from this element
2222
TEMPORARY_ARRAY = longestSub(TEMPORARY_ARRAY) #We calculate the longest sub array that starts from this element
2323
if ( len(TEMPORARY_ARRAY) > len(LONGEST_SUB) ): #And we save the longest sub array that begins from an element smaller than the pivot (in LONGEST_SUB)

0 commit comments

Comments
 (0)