### Present Remotely

Send the link below via email or IM

Present to your audience

• Invited audience members will follow you as you navigate and present
• People invited to a presentation do not need a Prezi account
• This link expires 10 minutes after you close the presentation
• A maximum of 30 users can follow your presentation

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

# Shell Sort

Algorithm for sorting
by

## Rahul Patel

on 4 May 2010

Report abuse

#### Transcript of Shell Sort

How Insertion Sort Works How Shell Sort Works Insertion Sort vs. Shell Sort iterator = 1
/*Sort is repeated for the 2nd element to the final element in the list*/
while (iterator is less than ListLength) {
temp = List[iterator]
index = iterator

/*Determines if a shift and swap needs to
while (temp is less than Previous List Value) {
//Values are copied one element to the right
}

/*After all values are shifted, sorted value is put
into place*/
a[index] = temp
iterator++
}
gapsize = ListLength / 2
while (gapsize is greater than or equal to 1) {
/*Last Insertion Sort to complete is of gapsize 1 (regular insertion sort)*/

iterator = gapsize
/*Sets first comparable element to the first one in the
second row*/

while (iterator is less than ListLength) {
//*Perform Insertion Sort Upon Each Column of the list*//
iterator++
}
gapsize = gapsize / 2
//creates new gapsize for next Insertion Sort
} Works Cited

Black, Paul E. "Shell Sort." National Institute of Standards and
Technology. 4 Sept. 2009. Web. 02 May 2010.

Briscoe, Wesley. "YouTube - Shell Sort with 7 Items.AVI." YouTube -
Broadcast Yourself. 13 Jan. 2010. Web. 02 May 2010.

Corman, Thomas H. "Sorting and Searching Algorithms." EPaperPress.
Web. 02 May 2010.
<http://epaperpress.com/sortsearch/index.html>.

"Shell Sort Algorithm." Games & Game Programming. Web. 02 May
2010.
<http://www.gamespp.com/algorithms/shellSortAlgorithm.html>.

"Shell Sort." Wikipedia, the Free Encyclopedia. Web. 03 May 2010.
<http://en.wikipedia.org/wiki/Shell_sort>.

"YouTube - Algorithms Lesson 2: Insertion Sort." YouTube - Broadcast
Yourself. 14 Apr. 2009. Web. 02 May 2010.