Skip to content

Commit 6e77eba

Browse files
Updated Bubble Sort description
Added the runtime, memory and a better description of bubble sort. The implementation was not added but it is good to know the concept.
1 parent 58bb5ef commit 6e77eba

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Bubble Sort/README.markdown

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# Bubble Sort
22

3-
This is a horrible algorithm. There is no reason why you should have to know it.
3+
Bubble sort is a sorting algorthim that is implemented by starting in the beginning of the array and swapping the first two elements only if the first element is greater than the second element. This comparision is then moved onto the next pair and so on and so forth. This is done until the the array is completely sorted. The smaller items slowly “bubble” up to the beginning of the array.
44

5+
Runtime:
6+
- Average: O(N^2)
7+
- Worst: O(N^2)
8+
9+
Memory:
10+
- O(1)
11+
12+
Implementation:
13+
The implemenatation will not be shown because as you can see from the average and worst runtimes this is a very inefficent algorithm but having a grasp of the concept will help in getting to know the basics of simple sorting algorthims.

0 commit comments

Comments
 (0)