# 電腦勁人入黎!!

Bubble Sort the following numbers:

50

61

6

70

25

34

how many steps did it take??

Graph the times for the bubble sort,insertion sort, quick sort and haep sort. Put all four into the same graph and compare them.

a) which one is the fastest?

b) is the fastest always the fastest?

c) is the slowest always the slowest?

The graph of the Bubble Sort looks strange.. it is smooth and then shows a sudden cusp. What value for ""m"" causes this??

Research a 5th sort. Explain how it works.

Create a flow chart for the Insertion Sort.

答得幾多得幾多!!!

### 1 Answer

- 9 years agoFavorite Answer
Q1. 8

Q2. a) quick sort

b) no

c) yes

Q3. 唔識

Q4. merge sort.

If the list is of length 0 or 1, then it is already sorted. Otherwise:

Divide the unsorted list into two sublists of about half the size.

Sort each sublist recursively by re-applying merge sort.

Merge the two sublists back into one sorted list.

Source(s): http://en.wikipedia.org/wiki/Merge_sort- Login to reply the answers