2 ms·
So your function needs to be passed current and next (or prev, depending on which direction you want to iterate). XOR-lists have lots of issues. This isn't on
by dpark 15y ago
So your function needs to be passed current and next (or prev, depending on which direction you want to iterate). XOR-lists have lots of issues. This isn't one of them.
- pheon 15y agoand your back to storing 2 pointers again.
- dpark 15y agoNo you're not. Your function needs to accept two pointers. Your data structure doesn't need to store two pointers. Unless you're storing external pointers to every node (in which case you'll actually break even with the traditional implementation in terms of size), you'll still have significant savings. Passing an extra pointer to a function is pretty trivial in terms of size.