Gnome Sort Algorithm - Almost Insertion Sort

Опубликовано: 29 Август 2021
на канале: Stephen Melvin
2,336
92

The gnome sort algorithm is a sorting algorithm that swaps adjacent elements if they're out of order, like bubble sort or cocktail sort, but instead of doing whole passes in one direction, it goes left if it swapped and right if it didn't. I'm gonna write the code for gnome sort and go through how it works step by step. I'll also show you what happens in different cases, like if it's already sorted, almost sorted or reversed.


Sorting Algorithms playlist:    • Sorting Algorithms  


00:00 Overview
00:35 Writing the gnome sort code
02:55 Explaining roughly
04:40 Adding a small optimisation
05:54 Explaining step by step
10:30 Showing the already sorted case
11:32 Showing the large shuffled case
12:45 Showing the reverse case
13:55 Showing the almost sorted case
14:16 Showing holding on swaps


На этой странице сайта вы можете посмотреть видео онлайн Gnome Sort Algorithm - Almost Insertion Sort длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Stephen Melvin 29 Август 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 2,336 раз и оно понравилось 92 зрителям. Приятного просмотра!