Timeline for What method should I use to populate a tree as I'm consuming data that is contained within the tree?
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 5, 2015 at 14:26 | history | tweeted | twitter.com/#!/StackProgrammer/status/640169171033178112 | ||
Aug 10, 2015 at 23:44 | answer | added | null | timeline score: 5 | |
Aug 10, 2015 at 15:24 | comment | added | Thomas Owens♦ |
@SteveEvers I don't have anything that isn't on a whiteboard now. I was actually just looking at a suffix tree implementation for the tree. If I have an ID number for W-X-Y-Z in every DataChunk , I can create the nodes and then populate as necessary with specific DataChunk instances that contain the information for each level. But I'll also look into an adjacency list.
|
|
Aug 10, 2015 at 15:21 | comment | added | Steven Evers | If you don't already have the data structure written then you could implement an adjacency list to hold the tree as if it were a DAG and just use a graph insert method (insert(node from, node to)) (runtime is O(E)) if I remember correctly). The graph would still be mutable during construction though. | |
Aug 10, 2015 at 15:01 | comment | added | Thomas Owens♦ |
@SteveEvers I don't get a complete layer in each chunk, though. A single DataChunk doesn't tell me how many Ws, Xs, Ys, or Zs I have.
|
|
Aug 10, 2015 at 14:53 | comment | added | Steven Evers | Because you get each layer in a chunk I'd look into breadth first traversal to build the tree | |
Aug 10, 2015 at 14:13 | comment | added | Thomas Owens♦ |
@null I never thought of treating each DataChunk as a subtree before. That may be interesting. I'll think about that, but if you could expand on it as an answer, that would be great. I'm not sure if there's anything that precludes it from happening.
|
|
Aug 10, 2015 at 14:11 | comment | added | null | Yes great, you receive a list of arbitrary sub-trees that should be "grown together" =) to one bigger tree that shouldn't be mutable. | |
Aug 10, 2015 at 14:06 | comment | added | Thomas Owens♦ | @null I've edited more detail into the question. Does that fully explain things? | |
Aug 10, 2015 at 14:01 | history | edited | Thomas Owens♦ | CC BY-SA 3.0 |
added 269 characters in body
|
Aug 10, 2015 at 13:53 | comment | added | Thomas Owens♦ |
@null A DataChunk may contain data for any of the nodes. It, by itself, never becomes a node at all. Pieces are extracted by each level to populate its fields.
|
|
Aug 10, 2015 at 13:51 | comment | added | null |
Does a DataChunk always become a W node or any kind of node?
|
|
Aug 10, 2015 at 13:41 | history | edited | Thomas Owens♦ | CC BY-SA 3.0 |
edited title
|
Aug 10, 2015 at 13:34 | history | asked | Thomas Owens♦ | CC BY-SA 3.0 |