DEV Community

manulangat1
manulangat1

Posted on

3 1

Visualizing Bubble sort algorithm in python using pygame.

Hello geeks,
I presume that this is my second or third post on this forum, so I do apologize for any errors.

Today we are going to visualize bubble sort algorithm in Python. Bubble sort is the simplest sorting algorithm that works by swapping adjacent elements in a list if they are not in the correct order. The time complexity of the bubble sort algorithm is O(n2) and the space complexity for Bubble sort is O(1) because only a single additional memory space is required.

Enough about the wordy part of it. Let us get into the tasty stuff...

Alt Text

And more...
Alt Text

I am sorry I didn't add comments to my code. Also, code reviews are welcome and constructive criticism.
You can follow me in Github through this link link

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post →

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay