Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

def bubbleSort( sorti ): #47

Closed
riya-kumari023 opened this issue Oct 12, 2023 · 0 comments
Closed

def bubbleSort( sorti ): #47

riya-kumari023 opened this issue Oct 12, 2023 · 0 comments

Comments

@riya-kumari023
Copy link

def bubbleSort( sorti ):
n = len( sorti )

for i in range( n - 1 ) :
    flag = 0

    for j in range(n - 1) :
        
        if sorti[j] > sorti[j + 1] : 
            tmp = sorti[j]
            sorti[j] = theSeq[j + 1]
            sorti[j + 1] = tmp
            flag = 1

    if flag == 0:
        break

return sorti

Originally posted by @riya-kumari023 in #23 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants