Upload

Loading icon Loading...

This video is unavailable.

Pancake sort algorithm, visualization with VTK

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to like Mario Storti's video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to dislike Mario Storti's video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to add Mario Storti's video to your playlist.

Uploaded on Nov 13, 2009

Pancake sorting ( http://en.wikipedia.org/wiki/Pancake_... ) is a variation of the sorting problem in which the only allowed operation is to reverse the elements of some prefix of the sequence. Unlike a traditional sorting algorithm, which attempts to sort with the least comparisons possible, the goal is to sort the sequence in as few reversals as possible. This operation can be visualized by thinking of a stack of pancakes in which one is allowed to take the top k pancakes and flip them.

Here we perform the visualization of a simple pancake sorting algorithm with VTK. The algorithm starts by flipping the top pancakes from the largest one to the top, so that the largest pancake goes to the top. Then, sorting the whole pancake stack we bring the largest pancake to the bottom. The subsequent move brings the second largest to the second position, and so on, recursively.

The VTK Python script is available here: http://www.cimec.org.ar/twiki/bin/vie...

Loading icon Loading...

Loading icon Loading...

Loading icon Loading...

Loading icon Loading...

Ratings have been disabled for this video.
Rating is available when the video has been rented.
This feature is not available right now. Please try again later.

Loading icon Loading...

Advertisement
Loading...
Working...
to add this to Watch Later

Add to