Node and Edge Counting Function in C Graph Implementation Counts Some Nodes Twice
I’m grappling with an issue in my code where a .DOT files nodes are being counted multiple times, especially when there are duplicates with the same name. I want to ensure that each node is counted only once, regardless of whether nodes with identical names exist. I tried using “return NULL” instead of “return node”, but it ended up triggering a memory error. Here are my codes, the output and the .DOT file:
Node and Edge Counting Function in C Graph Implementation Counts Some Nodes Twice
I’m grappling with an issue in my code where nodes are being counted multiple times, especially when there are duplicates with the same name. I want to ensure that each node is counted only once, regardless of whether nodes with identical names exist. I tried using “return NULL” instead of “return node”, but it ended up triggering a memory error. Any suggestions on how to fix this?