3 ms·
A little whitespace goes a long way. Were the list elements also stored in sequence in some array, or is ->lnk a two-element array with the forward and backwar
by nitrogen 13y ago
A little whitespace goes a long way. Were the list elements also stored in sequence in some array, or is ->lnk a two-element array with the forward and backward pointers?
- NAFV_P 13y agoThe latter applies here, this is the node: typedef struct dll__ { struct dll__ *lnk[2]; void *dat; }ndi; I've seen some examples on the web, but I haven't seen it done this way. I have a suspicion it might be slower than the traditional technique, but I'll have to check that. What is not evident from the code snippet is that I'm trying to make the code handle both fixed end and looped lists.