English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

You'd have to share with us the algorithm as your homework assignment gives it. The way it describes a (!!) bubble sort might already be a way some other people consider it 'a little more efficient' than the vanilla flavored one.

2007-02-19 17:31:00 · answer #1 · answered by Anonymous · 0 0

Let's say you have an unsorted list of length Φ. After the first run-through, the largest element will be at position Φ. It is no longer necessary to check the last element since we know it is the largest. So on the next run-through, we only need to sort the list from position 1 to Φ-1. On the next run-through, you would only need to sort the list from 1 to Φ-2. This slight improvement removes one iteration after each run-through until the list is sorted.

2007-02-20 01:37:47 · answer #2 · answered by Kookiemon 6 · 0 0

fedest.com, questions and answers