Bubble Sort

  Рет қаралды 25

compscistudy

compscistudy

Күн бұрын

In this video we are going to use the bubble sort algorithm to sort a list of 5 numbers. The bubble sort algorithm works by taking the value in the first position of the list and comparing it to the value in the second position of the list. If the value in the second position of the list is less than the value in the first position of the list, the values are swapped, with the smaller value taking the lower position. This continues until the value stored in the last position is compared to the value stored in the second to last position of the list. Ultimately, this first pass on the list will set the largest value in the list to the highest position in the list.
If the length of the list is represented by n, after n-1 passes, the list will be completely sorted.
The bubble sort algorithm has a time complexity of O(n^2) in the worse case and O(n) in the best case.

Пікірлер
Insertion Sort
3:42
compscistudy
Рет қаралды 16
10 FORBIDDEN Sorting Algorithms
9:41
Ardens
Рет қаралды 859 М.
Girl, dig gently, or it will leak out soon.#funny #cute #comedy
00:17
Funny daughter's daily life
Рет қаралды 27 МЛН
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,6 МЛН
Oh, wait, actually the best Wordle opener is not “crane”…
10:53
Bubble, Merge & Insertion Sort Algorithms
8:42
MrBrownCS
Рет қаралды 101 М.
If You Know These 15 Words, Your English is EXCELLENT!
7:39
Brian Wiles
Рет қаралды 1,8 МЛН
Insertion Sort vs Bubble Sort + Some analysis
5:17
udiprod
Рет қаралды 322 М.
Visualization of Quick sort (HD)
3:12
udiprod
Рет қаралды 853 М.
Bubble Sort - CS50 Shorts
5:55
CS50
Рет қаралды 120 М.
Sorts 8 Quick Sort
9:12
RobEdwards
Рет қаралды 196 М.
Bubble sort algorithm
10:24
mycodeschool
Рет қаралды 1,7 МЛН
Girl, dig gently, or it will leak out soon.#funny #cute #comedy
00:17
Funny daughter's daily life
Рет қаралды 27 МЛН