The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsIs it possible for a node in a linked list to point to more than one node
Also, is it possible for a node to have more than one node pointing to it?
At 4/12/11 05:04 PM, Tygerman wrote: Is it possible for a node in a linked list to point to more than one node
Also, is it possible for a node to have more than one node pointing to it?
This isn't really about flash, but programming and implementation in general, but I'll help you out.
Nodes can traditionally point to either one or two other nodes, which are called singly linked lists, and doubly linked lists. The nodes for each are designed differently.
Singly Linked Lists:
-Nodes have two internal objects. one is the data, and the other is a pointer to the next Node object.
-Can be easily traversed forwards, because there is a Direct linke from each node to the next, but harder to go backwards, because there is no way of knowing which node this node has been linked from.
Doubly Linked Lists:
-Nodes have 3 internal Objects. The data, a pointer to the previous node, and a pointer to the next node.
-These lists can be easily traversed either forwards or backwards, because there is an explicit reference both ways.
If you link a node to two "next nodes" and one previous nodes, you create a sort of data tree, and it is no longer really a "List." It's all about what you want to do.
Picture below to help you understand.
At 4/12/11 05:04 PM, Tygerman wrote: Is it possible for a node in a linked list to point to more than one node
Also, is it possible for a node to have more than one node pointing to it?
If by node you mean internal node, then yes... doesn't it already do so with the previous and next pointers?
Not sure why you ask this though, seems more like a basic programming homework question too me :p.
You can ask me anything about AS3, PHP, HTML, CSS, JavaScript, Ruby, Python, Java, XML, JSON, Photoshop, and some more....
Ah, nevermind me, Tenentenen pretty much gave a full answer.
You can ask me anything about AS3, PHP, HTML, CSS, JavaScript, Ruby, Python, Java, XML, JSON, Photoshop, and some more....