Re: hacker challenge - traverse a list



cri@xxxxxxxx (Richard Harter) writes:

Here is a little challenge - print the contents of a binary tree
in order only using O(1) additional memory.

Do you want to limit runtime to O(n) or forbid modifying the
binary tree? I can think of a simple solution in the latter
category, and I have the sketch of a solution in the former
category.

Is it a binary search tree or an arbitrary binary tree?
--
Ben Pfaff
http://benpfaff.org
.



Relevant Pages

  • Whats the difference of hash table and binary tree?
    ... hash table gives you Osearching but according to your hash ... binary tree gives you Osearching but less memory. ...
    (comp.lang.c)
  • Re: Whats the difference of hash table and binary tree?
    ... Christopher Layne wrote: ... binary tree gives you Osearching but less memory. ... Hash or binary ...
    (comp.lang.c)
  • Re: Memory Question
    ... off 1Gb binary tree I could just read into a C program. ... But it's not normal, most of the time, to design software so that ... highest-specced hardware. ... I wasn't saying that the OP /should/ just go for more memory; ...
    (comp.lang.c)
  • Re: Whats the difference of hash table and binary tree?
    ... binary tree gives you Osearching but less memory. ... The binary tree requires considerably more care to avoid a worst ...
    (comp.lang.c)
  • Compress Lexico
    ... with new line character. ... I need to keep content of the file in memory during run time, ... I would like to compress the content of the file and load it in to ... Is the Binary Tree good solution for Scrabble? ...
    (comp.lang.java.programmer)