Skip to content

Commit e1bd6c2

Browse files
committed
Add gifs
1 parent a1053ab commit e1bd6c2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/sort/bubble/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Bubble Sort
22
*Largest element will be bubbled to the last in every pass*
33

4+
### How It Works:
5+
![Bubble Sort](https://upload.wikimedia.org/wikipedia/commons/c/c8/Bubble-sort-example-300px.gif)
6+
7+
Starting from the beginning of the list, compare the next pair. Swap their positions if they are not in the right order (the second one in the pair is smaller than the first one in the pair). After each iteration, one less element (the last one) is needed to be compared until there are no more elements left to be compared.
8+
49
### Time Complexity
510

611
---

src/sort/selection/README.MD

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Selection Sort
22
*Select the minimum element and move it to its correct place in every pass*
33

4+
### How It Works:
5+
![Selection Sort](https://upload.wikimedia.org/wikipedia/commons/9/94/Selection-Sort-Animation.gif)
6+
* Red is current min.
7+
* Yellow is sorted list.
8+
* Blue is current item.
9+
10+
411
### Time Complexity
512

613
---

0 commit comments

Comments
 (0)