Hello,
I'm working on a Project Euler problem ( and one of the problems uses a binary tree stored in a file. All the nodes are fully leafed-out, up until the last row.
I can't think of a way to populate a binary tree from a file like that - usually recursion is in order but I don't know how to code a way to traverse the tree that corresponds to a way of parsing the file!
While I enjoy making my code as open-ended as possible, since this is a one-off for this particular problem, I can put as many constraints into the code as possible (I know how many levels the tree has, etc) to make this work.
Any help is appreciated, even a "google this" and a "try this kind of tree traversal".. Thanks!
Tao Te Ching Discussions : Chapter 9 (includes links to previous chapters)
What is the nature of conflict?
I'm working on a Project Euler problem ( and one of the problems uses a binary tree stored in a file. All the nodes are fully leafed-out, up until the last row.
I can't think of a way to populate a binary tree from a file like that - usually recursion is in order but I don't know how to code a way to traverse the tree that corresponds to a way of parsing the file!
While I enjoy making my code as open-ended as possible, since this is a one-off for this particular problem, I can put as many constraints into the code as possible (I know how many levels the tree has, etc) to make this work.
Any help is appreciated, even a "google this" and a "try this kind of tree traversal".. Thanks!
Tao Te Ching Discussions : Chapter 9 (includes links to previous chapters)
What is the nature of conflict?