Answer the question
In order to leave comments, you need to log in
How to serialize B-tree java?
I implemented the Serializable interface and tried to write the entire tree to a file using the writeObject method on the ObjectOutputStream. The write succeeded, but the read failed with a java.lang.StackOverflowError
static class Node implements Serializable {
char code;
long frequency;
boolean terminal;
byte keyVal;
LinkedList<Node> children;
public Node() {
this.frequency = 0;
this.terminal = false;
this.keyVal = 0;
this.children = new LinkedList<Node>();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question