Self-referential data structure: Difference between revisions

From Computer Science Wiki
No edit summary
No edit summary
 
Line 3: Line 3:
A self-referential structure is one of the data structures which refer to the pointer to (points) to another structure of the same type. For example, a [[Linked list|linked list]] is supposed to be a self-referential data structure. The next node of a node is being pointed, which is of the same struct type. <ref>https://www.careerride.com/C-self-referential-structure.aspx</ref>
A self-referential structure is one of the data structures which refer to the pointer to (points) to another structure of the same type. For example, a [[Linked list|linked list]] is supposed to be a self-referential data structure. The next node of a node is being pointed, which is of the same struct type. <ref>https://www.careerride.com/C-self-referential-structure.aspx</ref>


It is a special type of structure which contains a member of its own type. The member of its own type is actually a pointer variable of same structure in which it is declared.<ref>https://ladderpython.com/lesson/self-referential-structure/</ref>


Within the context of blockchain, each block is linked to a previous or next node, much like a linked list.  
Within the context of blockchain, each block is linked to a previous or next node, much like a linked list.  

Latest revision as of 15:01, 9 March 2020

Programming[1]

A self-referential structure is one of the data structures which refer to the pointer to (points) to another structure of the same type. For example, a linked list is supposed to be a self-referential data structure. The next node of a node is being pointed, which is of the same struct type. [2]

It is a special type of structure which contains a member of its own type. The member of its own type is actually a pointer variable of same structure in which it is declared.[3]

Within the context of blockchain, each block is linked to a previous or next node, much like a linked list.

References[edit]