You're right, it's a stupid idea.
My problem is that the graph is static, but when I have to retrieve a node I
don't know what the index of the node is, I only know what is its ID in the
case that the node is present.
The graph could be very huge, as I am performing instrumentation of Java
bytecode, and the nodes are representing methods. For reasons I'm not
explaining because it would take too long, it could be possible that some
methods I encounter are not in the graph, so before taking action I have to
ensure that they are by calling getNode(methodID), where ID is a unique String
based on the method signature.
Honestly I can't think of a way of knowing in advance what the corresponding
index for my ID would be, so I'm probably forced to keep complexity O(n).
Archives gérées par MHonArc 2.6.16.