Skip to content

Dynamic Programming / en: pseudocode is incomplete #5427

@Noreaster76

Description

@Noreaster76

Unless I'm mistaken, the if statement at the bottom of the Longest Subsequence pseudocode doesn't actually do anything:

for i=0 to n-1
    LS[i]=1
    for j=0 to i-1
        if (a[i] >  a[j] and LS[i]<LS[j])
            LS[i] = LS[j]+1
for i=0 to n-1
    if (largest < LS[i])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions