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

Опубликовано: 17 Апрель 2024
на канале: 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


Смотрите видео Data Structures and Algorithms Shell Sort | Time Complexity | DSA Programming онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Prashant Rana 17 Апрель 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 58 раз и оно понравилось 5 людям.