Raul Miller-4 wrote: > > On Tue, Jan 12, 2010 at 7:10 PM, Viktor Cerovski > <[email protected]> wrote: >> It's not always ridiculous---for example, merging two sorted arrays of >> total >> length n into a sorted array merge does in O(n) while /:~ in O(n log n). > > /:~ is O(n), sometimes. > > True. But when? merge is O(1) sometimes. The worst case for merge is when merging a single element with a sorted array. It's O(n), while binary search will do it in O(log n).
-- View this message in context: http://old.nabble.com/Rosetta-code%3A-Merge-Sort-tp27131286s24193p27146716.html Sent from the J Programming mailing list archive at Nabble.com. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
