Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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