Implement serialization/deserialization for a tree data structure. Part 1: A binary tree Part 2: An n-ary tree I did not need to focus on the format of the serialized string or error handling.
Anonymous
I built a basic tree class, then added serialize and deserialize methods. Both methods were recursive. The serialize method used a starter method to create a stringstream to pass to the helper method and then return the string from the stream at the end. The deserialize method used a stringstream to allow me to read input one line at a time for relatively easy parsing.
Check out your Company Bowl for anonymous work chats.