3 ms·
imo you solve these problems by segregating the ownership logic and relationship logic of the data structure. In other words the DAG would never be traversed t
by holy_city 7y ago
imo you solve these problems by segregating the ownership logic and relationship logic of the data structure.
In other words the DAG would never be traversed to allocate or free memory, each vertex would be held by a vector or other container and the edges represented by an adjacency list/matrix.
It's faster and safer than pointer chasing.