[Haskell-beginners] Removing the biggest element from a list - maybe slow?

Daniel Fischer daniel.is.fischer at web.de
Mon May 24 10:53:42 EDT 2010


On Monday 24 May 2010 16:47:50, Daniel Fischer wrote:
>  But if the order is changed, it can be done in O(n).

And by that I meant
"in O(n) time with one traversal and in constant space", since

delete (maximum xs) xs

is O(n) time too and doesn't change the order.



More information about the Beginners mailing list