Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Triply Linked Lists

Name: Anonymous 2013-02-21 20:58

Are they really worth the memory overhead?

Name: Anonymous 2013-02-21 21:02

"Memory overhead": 2 extra pointers.

Depends on your requirements. Is it the right data structure? Usually, doubly linked lists aren't the right one to use. Unless you happen to be fetching the items like if you were some kind of Anal Touring machine.

Name: Anonymous 2013-02-21 21:09

Totally, I use them all the time. I find the protection provided by storing a pointer to a random memory location a good way to deter hackers. Sometimes I make my triple link list, then use them as a singly linked list, and fill the other two with garbage, so debugging will be harder.

I'd like to make quadruply linked list, but the trade offs are a little to  steep.

Name: Anonymous 2013-02-22 2:27

I.. don't get it.
So you have a pointer to the next node, one to the previous node and.. where does the third pointer go?

Name: Anonymous 2013-02-22 2:32

>>4
To the current node.
tll->thisnode->data = tll->->thisnode->thisnode->thisnode->data = tll->->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->thisnode->data

Name: Anonymous 2013-02-22 4:32

>>5
Why would you want this?

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-02-22 4:42

Triply Linked Lists
Also known as a tree.

Name: Anonymous 2013-02-22 4:44

>>6
To confuse idiots like you.

Name: Anonymous 2013-02-22 4:48

>>7
Singly-linked lists are also trees.

Name: Anonymous 2013-02-22 5:04

It's pretty hard to tell without explaining how it's being used. If you're using a binary search tree and using another pointer to handle collisions, then it may or may not be beneficial depending on the type of data you're handling. For example, if you're just inserting and comparing against strings, then you'd probably be better off using an integer which keeps track of how many duplicates there are, rather than allocating the same data over and over again. On the other hand, if you have a string for comparison and you're inserting other data which is likely to vary with two strings that compare equal, then there aren't many other choices.

Name: Anonymous 2013-02-22 5:35

>>1
if you need triple linked lists in your program then yes, it's worth it.

Name: Anonymous 2013-02-22 21:06

>>7,9
I like to use nullary trees wherever possible because I can fit the entire structure in a register.

Don't change these.
Name: Email:
Entire Thread Thread List