Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 14
    Why are you trying to force this into a binary tree? As you say, the structure much more naturally fits a wider tree. Commented Dec 30, 2018 at 18:57
  • 1
    A linked list is a degenerate binary tree. So, you need to articulate the constraints on the binary tree, or else, a tree with no left (or right) hand side elements would suffice (and you could use linked list algorithm on it). Constraints like whether it is kept balanced and/or sorted... (Let's say there's only one element. What does your problem allow for the shape of the tree?) Commented Dec 30, 2018 at 19:06
  • 1
    @Philip Kendall i just wanted to approach the problem with binary trees. Commented Dec 31, 2018 at 6:32
  • in general directory structures are not even trees, you need at least a DAG to handle hard links, if you want to use the same structure for sym links you need a directed graph. Commented Jan 2, 2019 at 11:49