Skip to content

method 2 in quick_sort.md may have a syntax error #23

@xlui

Description

@xlui

the statement is awesome but there are bugs in the code of method 2

def qsort(L):
    return (qsort([y for y in L[1:] if y <  L[0]]) +
                  L[:1] + 
                  [y for y in L[1:] if y == L[0] + qsort([y for y in L[1:] if y > L[0]]) ) \
                  if len(L) > 1 else L

'[' does not appear in pairs.

maybe you need a ']' after if y == L[0] in line 4.

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