Yes. If you're traversing some structure, it is easier to call graph.addNode() immediately than to create intermediate array for nodes.