Hello, I'm new to hashtables in C#, and I'm trying to refer to a bit of Java code, but having a problem.
Here's the Java...
note: adjacencyMap is a Java hashmap.
int count = 0;
for (int i=0; i< adjacencyMap.CAPACITY; i++)
{
if (adjacencyMap.keys[i] != null)
{
LinkedList edges = (LinkedList) adjacencyMap.get(adjacencyMap.keys[i]);
count+=edges.size();
}
}
return count;
Ok, and here's how I've got it translated to C#...
int count = 0;
for (int i=0; i < adjacencyMap.Count; i++)
{
if (adjacencyMap[i] != null)
{
List<T> edges = (List<T>) adjacencyMap[adjacencyMap[i]];
count += edges.Count;
}
}
return count;
I'm getting problems where I translated the Java lines that contain "keys".
Thanks!