Hello Dusan,

Monday, August 29, 2005, 9:55:56 AM, you wrote:

>Nevertheless, for the other algorithm the expected time complexity  (
>quite well known in general :-) )  and measured values do no fit together.

number of reductions is not exact time statistics. try the following
alternative length definition ;)

length2 (_:_:_:_:_:_:_:_:_:_:xs) = (length2 xs)+10
length2 (_:xs)                   = (length2 xs)+1
length2 _                        = 0

and compare number of reductions for:

length [1..5000]
length2 [1..5000]


-- 
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]



_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to