I read in the specifications for graphs implemented with Adjacency List that adding edges is done in constant time. BUT that would require a node lookup with O(1). I would like best possible performance. The question here is which datatype would would give me that. Hashmap has been considered, worst case with hashmap is still O(n).
Could I use an Array for this? The node's can be of any datatype, generics. Could this be done with some hash function generating index values based on the node alone? That would give me O(1). Sure I can just capitalize and use LinkedList with indexOf. Constant time is best.