in reply to Re^3: Challenge: Perl 5: lazy sameFinge()?
in thread Challenge: Perl 5: lazy sameFringe()?
And as I said thats not expensive for binary trees.
I'll qualify it as "half-lazy" if you want, b/c of the on-demand.
IMHO, real lazy means no big-copies at all... (see requirements)
Just imagine a non-binary tree like [[1..1e8]] then your algorithm would double the memory needed.
Cheers Rolf
( addicted to the Perl Programming Language)
PS: I wouldn't be surprized if your algorithm was faster than hdb's but with the advantage to be able to handle non-binary trees.
|
|---|