Join Raghavendra Dixit for an in-depth discussion in this video Shell sort example, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] Consider an array of size 100,…and it will be difficult to show all the elements…of the array, so we really show only the relevant portions…such that the shell sort algorithm is understood.…If you have 100 elements according to the node sequence,…the interval that we choose for the first time…between elements is 40.…So this means, that for the first pass of the first…iteration, we will choose the elements at zeroth index,…40th index, and 80th index, because the interval is 40.…
And then we will sort these three elements, that is,…we sort of ignore all other elements for the time being.…So after sorting these three elements,…our array would look something like this.…Then in the next pass of the first iteration,…we will choose the adjacent elements, that is,…elements at index one, 41 and 81.…So the interval is still 40, right?…And sort these three elements, after which,…this is how our array looks like.…
And then we move to the next index, still keeping…the interval at 40, and sort these elements.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Why study data structures and algorithms?
- How to calculate the time complexity
- Using Big O notation
- Using basic sorting and search algorithms
- Searching elements in unordered arrays and ordered arrays
- Implementing a linked list in Java
- Implementing stacks using arrays
- Queues using arrays
- Binary search trees
- Representing heaps using arrays
Skill Level Intermediate
1. Introduction to Algorithms
2. Analysis of Algorithms
3. Basic Sorting and Search Algorithms
4. Linked Lists
5. Stacks and Queues
7. Binary Search Trees
8. More Sorting Algorithms
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.