Google Interview Question
Software Engineer / DevelopersGood idea to ask questions. Here are some more.
Does the graph datatype contain information that could be discarded?
Is it necessary to code for minimum size of serialized representation?
One solution is to use industry standard like @XmlRootElement on the graph data type. You can set to ignore variables for json or xml serialization with appropriate annotations as well.
If the tree is binary, you could serialize the objects in an array to get rid of some of the bloat.
I guess useful questions would also be :
- Anonymous February 05, 2012is the graph directed?
is it sparse or dense?
and depending on that choose either adjacency list or adjacency matrix