D
D
dimamoshurenko2016-08-07 18:56:07
Android
dimamoshurenko, 2016-08-07 18:56:07

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 question

Ask a Question

731 491 924 answers to any question