2 ms·
> The 'indirect pointer' points to the memory address of the previous 'next' (or the head). I don't think so. I think the 'indirect pointer' points to the prev
by Thorrez 6y ago
> The 'indirect pointer' points to the memory address of the previous 'next' (or the head).
I don't think so. I think the 'indirect pointer' points to the previous 'next' (or the head). It doesn't point to the address of the previous 'next' (or the head). What you say is adding an additional level of indirection that doesn't exist.
Reality:
indirect -> previous next -> first element
What you're saying:
indirect -> address of previous next -> previous next -> first element
In reality indirect contains the address of the previous next, but it doesn't point to the address of the previous next.
- ndand 6y agoThe "indirect" variable does not point to a list entry directly, like what "head" and "next" variables do, that's why it's named "indirect".
- Thorrez 6y agoI agree: indirect -> previous next -> first element "indirect" points to "previous next". "previous next" isn't a list entry. "previous next" points to "first element", which is a list entry.