Answer the question
In order to leave comments, you need to log in
Saving the tree structure to a file, best way?
Good day everyone, I ran into the problem of choosing a data structure and a file for storing the N-tree.
The object, in fact, is the following:
class Node{
int data;
Node[] childArray;
}
int node = 0b1111111111_00000000_11111111;
// 1ые 8 бит отвечают за данные
// 2ые 8 бит child_size
// 3ие 8 бит информируют о необходимом смещении в массиве, чтобы дойти к следующему элементу на текущем уровне
Answer the question
In order to leave comments, you need to log in
to add an arbitrary node to the tree, you should go through all the nodes to correct the node offsets in the file and overwrite.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question