Python Forum
Bubble sort quiz: why the result is not the same?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bubble sort quiz: why the result is not the same?
#2
Are you sure you're doing it properly?
This sounds like a theoretical question, as opposed to a brute force question.
Refer to: Link

Also, I'm no python expert, but some things I believe can be improved:
1- bubblesortOnePass()'s return value is never used, so you don't need to return l.
2- Is it good to define a local counter in line 50, then a global counter in line 17?
3- range(len())
4- Since you pass K into bubblesortTwoPass(), I would use k, as opposed to l inside the function.
5- If I had to guess, the problem might be line 29.
Reply


Messages In This Thread
RE: Bubble sort quiz: why the result is not the same? - by IAMK - Apr-24-2018, 05:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QUIZ GUI Form_When admin panel is open, main quiz form is getting freeze Uday 4 810 Aug-25-2023, 08:24 PM
Last Post: deanhystad
Photo a.sort() == b.sort() all the time 3lnyn0 1 1,368 Apr-19-2022, 06:50 PM
Last Post: Gribouillis
  Python Networkx: Visualize an edge weight with a bubble/circle uvw 0 2,046 Sep-01-2021, 06:26 AM
Last Post: uvw
  Bubble sort on randomized integers bellevie 4 5,413 May-16-2017, 05:28 PM
Last Post: bellevie

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020