Write the algorithm that puts the first four terms of a list of arbitrary length in increasing order. Show that this algorithm has time complexity 0 (1) in terms of the number of comparisons used.

Printable View

- October 8th 2010, 08:59 AMilovemymathAlgorithms
Write the algorithm that puts the first four terms of a list of arbitrary length in increasing order. Show that this algorithm has time complexity 0 (1) in terms of the number of comparisons used.

- October 8th 2010, 09:04 AMemakarov
The forum rules say that it is expected that you will show some effort. Could you write a first draft of the algorithm, say how lists are represented and accessed, or at least tell what exactly your difficulty with this question is?

- October 8th 2010, 09:48 PMCaptainBlack