Search

Bubble Sort

Characteristics

Time Complexity: O(n2)O(n^2)
Space Complexity: O(n)O(n)

Instructions

1.
Select the first two value from the unsorted array
2.
Compare two values until there are no more value at the second value
a.
If first value is greater than the second value, swap
b.
Else, move to the next values
3.
Repeat 1 - 2 until all the values are sorted

Reference

Big O Notation - Full Course
This course will teach you how to understand and apply the concepts of Big O Notation to Software Engineering. Big-O notation is a way to describe how long an algorithm takes to run or how much memory is used by an algorithm. ✏️ This course was developed by selikapro. Check out his channel: https://www.youtube.com/channel/UC5UgemAz061hkjTFHOfxNpg 🔗 Twitter: https://twitter.com/selikapro 🔗 Instagram: https://www.instagram.com/selikapro ⭐️ Course Contents ⭐️ ⌨️ (0:00:00) Intro ⌨️ (0:00:39) What Is Big O? ⌨️ (0:07:08) O(n^2) Explanation ⌨️ (0:14:06) O(n^3) Explanation ⌨️ (0:26:29) O(log n) Explanation Recursive ⌨️ (0:31:12) O(log n) Explanation Iterative ⌨️ (0:36:08) O(log n) What Is Binary Search? ⌨️ (0:41:30) O(log n) Coding Binary Search ⌨️ (0:58:12) O(n log n) Explanation ⌨️ (1:02:50) O(n log n) Coding Merge Sort ⌨️ (1:17:04) O(n log n) Merge Sort Complexity Deep Dive ⌨️ (1:28:06) O(2^n) Explanation With Fibonacci ⌨️ (1:36:02) O(n!) Explanation ⌨️ (1:47:19) Space Complexity & Common Mistakes ⌨️ (1:55:53) End 🎉 Thanks to our Champion and Sponsor supporters: 👾 Wong Voon jinq 👾 hexploitation 👾 Katia Moran 👾 BlckPhantom 👾 Nick Raker 👾 Otis Morgan 👾 DeezMaster 👾 Treehouse 👾 AppWrite -- Learn to code for free and get a developer job: https://www.freecodecamp.org Read hundreds of articles on programming: https://freecodecamp.org/news