Shell Sort Algorithm (Theory + Working + Pseudocode) with Example | Part - 1 | Sorting Algorithms

  Рет қаралды 22,436

Simple Snippets

Simple Snippets

Күн бұрын

Support Simple Snippets by Donations -
Google Pay UPI ID - tanmaysakpal11@okicici
PayPal - paypal.me/tanmaysakpal11
--------------------------------------------------------------------------------------------- Understand the working of Shell sort algorithm with example and diagram. In this tutorial we will understand in detail how shell sort works with the help of a diagram. We will also dry run the pseudo code of shell sort with an example to understand how the shell sort algorithm progresses at every step.
1) ShellSort is an in-place comparison sort.
2)It is mainly a variation of sorting by exchange (bubble sort) or sorting by insertion (insertion sort)
3) This algorithm avoids large shifts as in case of insertion sort, if the smaller value is to the far right and has to be moved to the far left.
4) The idea of shellSort is to allow exchange of far items.
5) This spacing is termed as interval or gap.
6) ShellSort is more efficient compared to Insertion Sort or Bubble sort specially when -
a. Smaller value elements are towards the end of the array/list
b. Large sized array/list
c. Efficiency depends on how we select the GAP/interval
Time Complexity -
1. Best Case - Ω(n log(n))
2. Worst Case - O(n^2)
3. Average Case - θ(n log(n)2)
Space Complexity - O(1)
Working Steps -
Step 1 − Initialize the value of gap/interval (here we take n/2 iteratively)
Step 2 − Compare 2 elements at the distance of gap at every iteration
Step 3 − if element at the left is smaller than element at the right, perform swap or shift(depending on whether you use bubble sort or insertion sort respectively)
Step 3 − Repeat until complete list is sorted.
Full DSA playlist - • Introduction to Data S...
Full Code & Theory article - simplesnippets...
C++ Programming Tutorials for Beginners Course - • Introduction to Comput...
Simple Snippets Official Website -
simplesnippets....
Simple Snippets on Facebook -
/ simplesnippets
Simple Snippets on Instagram -
/ simplesnippets
Simple Snippets on Twitter -
/ simplesnippet
Simple Snippets Google Plus Page -
plus.google.co...
Simple Snippets email ID -
simplesnippetsinfo@gmail.com
For More Technology News, Latest Updates and Blog articles visit our Official Website - simplesnippets....
#shellsort #sortingalgorithms #datastructures #algorithms

Пікірлер: 29
@ShubhamKumar-km8pm
@ShubhamKumar-km8pm Жыл бұрын
Man brilliant explanation my all doubts got clear when you dry run the code.🔥
@DiegoI-i9v
@DiegoI-i9v 5 ай бұрын
Thank you! I know understand shell sort after watching this video.
@alltype_info
@alltype_info 3 жыл бұрын
wow👏👏. Great explanation in a detailed way. Thank you for your patience ...
@gamsterilyass2952
@gamsterilyass2952 28 күн бұрын
the best of all time ❤
@juanmauriciomugni5783
@juanmauriciomugni5783 3 жыл бұрын
Excellent, Greetings from Argentina !!
@SimpleSnippets
@SimpleSnippets 3 жыл бұрын
Thank you very much. warm welcome from India 😇
@raidenheath8985
@raidenheath8985 3 жыл бұрын
i dont mean to be offtopic but does anyone know a tool to log back into an Instagram account?? I somehow forgot my login password. I love any assistance you can offer me
@wilsonstetson5261
@wilsonstetson5261 3 жыл бұрын
@Raiden Heath Instablaster :)
@raidenheath8985
@raidenheath8985 3 жыл бұрын
@Wilson Stetson i really appreciate your reply. I got to the site thru google and I'm in the hacking process now. Takes quite some time so I will reply here later when my account password hopefully is recovered.
@raidenheath8985
@raidenheath8985 3 жыл бұрын
@Wilson Stetson it worked and I actually got access to my account again. I'm so happy! Thanks so much, you really help me out!
@saurabhsable15
@saurabhsable15 3 жыл бұрын
खूप छान समजून सांगितलं.
@qalb_e_momin5586
@qalb_e_momin5586 2 жыл бұрын
A lot of respect 🤗🤗🤗sir from PAKISTAN
@TheUtuber999
@TheUtuber999 11 ай бұрын
Very well explained. Thank you so much!
@SimpleSnippets
@SimpleSnippets 11 ай бұрын
Glad it was helpful!
@samarthtandale9121
@samarthtandale9121 2 жыл бұрын
You are The Best !!!
@masumali8356
@masumali8356 2 жыл бұрын
You are the best.....masum
@nargesghanbari2340
@nargesghanbari2340 3 жыл бұрын
exellent,greatings from Iran
@karanthakkar4423
@karanthakkar4423 4 жыл бұрын
Great sir Can please publish a book with same example?
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Everything is available for free on our official website. check the link in the video description :-)
@zelda8697
@zelda8697 Жыл бұрын
tank you,,this was helpful
@engineers2374
@engineers2374 4 жыл бұрын
is it helpful in also in mtech
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
Yes it is.
@ChandrapalSd
@ChandrapalSd 4 жыл бұрын
(BSc+MSc) CS vs (BCA+MCA) . Please give your opinion
@siddhartharoy5263
@siddhartharoy5263 4 жыл бұрын
BCA+MCA
@vimleshkumarkanaujiya
@vimleshkumarkanaujiya 3 жыл бұрын
Depends on Knowledge, but mostly (BSc + MSc) in CS
@israrqayyum7
@israrqayyum7 5 ай бұрын
CFBR
@GTXKritartHKRITARTH
@GTXKritartHKRITARTH 4 жыл бұрын
where are u from i am a guge fan💖💖💖💖💖💖💖💖
@SimpleSnippets
@SimpleSnippets 4 жыл бұрын
I am from Mumbai bro, what about you ? And thank you 😇
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
АЗАРТНИК 4 |СЕЗОН 3 Серия
30:50
Inter Production
Рет қаралды 966 М.
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 20 МЛН
Shell Sort - Data Structures & Algorithms Tutorial Python #18
18:33
Every Sorting Algorithm Explained in 120 minutes (full series)
1:57:33
Kuvina Saydaki
Рет қаралды 64 М.
Bubble Sort Algorithm - Theory + Code
46:37
Kunal Kushwaha
Рет қаралды 323 М.
Sorting Algorithms Explained Visually
9:01
Beyond Fireship
Рет қаралды 536 М.