|
|
|
|
|
by BosStartup
1480 days ago
|
|
This has the same issues as just using an array to store the data. If you remove a node in the list now you have to rewrite all the values in the links array. If you don't do that then you have to implement your own garbage collector and pay the penalty periodically. |
|
You actually don't. You can just keep two lists within the same structure, one for occupied nodes and one for free nodes, and just move deletions to the head of the free nodes list.
Example List:
Link shape: To Delete C: This changes the data such: New shape: