Re: hacker challenge - traverse a list
- From: Andrey Tarasevich <andreytarasevich@xxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 11:29:29 -0800
Richard Harter wrote:
Here is a little challenge - print the contents of a binary tree
in order only using O(1) additional memory.
What exactly is a "binary tree" in this case?
In a tree that has child->parent links in addition to parent->child links the solution is trivial. No hacks necessary.
In a tree that only has parent->child links the the problem has no solution with O(1) memory (the way you "defined" it in your "debatably" part).
--
Best regards,
Andrey Tarasevich
.
- Follow-Ups:
- Re: hacker challenge - traverse a list
- From: Richard Harter
- Re: hacker challenge - traverse a list
- References:
- hacker challenge - traverse a list
- From: Richard Harter
- hacker challenge - traverse a list
- Prev by Date: Re: hacker challenge - traverse a list
- Next by Date: Re: hacker challenge - traverse a list
- Previous by thread: Re: hacker challenge - traverse a list
- Next by thread: Re: hacker challenge - traverse a list
- Index(es):
Relevant Pages
|