Data Structures and Algorithms Shell Sort | Time Complexity | DSA Programming

Published: 17 April 2024
on channel: Prashant Rana
58
5

Shellsort, also known as Shell sort or Shell's method, is an in-place comparison sort based algorithm. It can be seen as either a generalization of sorting by exchange or sorting by insertion. The method/algorithm works by sorting pairs of elements far apart from each other from a certain distance/gap, then progressively reducing the gap between elements to be compared.
After every Iteration we reduce the gap by n/2 and then compare the elements till we reach gap greater than 0.

And then at last we get the Sorted List of the Elements.

Shellsort Complexity -
Worst Case - Time Complexity - O(N^2)
Space Complexity - O(1)

#shellsort #dsalgo #datastructures #algorithm #java


Watch video Data Structures and Algorithms Shell Sort | Time Complexity | DSA Programming online without registration, duration hours minute second in high quality. This video was added by user Prashant Rana 17 April 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 58 once and liked it 5 people.