answersLogoWhite

0

What is self referential structure?

Updated: 8/10/2023
User Avatar

Wiki User

14y ago

Best Answer

It is exactly what it sounds like: a structure which contains a reference to itself. A common occurrence of this is in a structure which describes a node for a linked list. Each node needs a reference to the next node in the chain.

struct linked_list_node {

int data;

struct linked_list_node *next; // <- self reference

};

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

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. For example,

struct link

{

int data;

struct link *next;

};

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is self referential structure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is self referential function in c plus plus?

A self-referential function in C++, or in any other supporting language, is a recursive function.


How is the data structure of system R different from the relation structure?

Unlike Relational systems in System R ? Domains are not supported ? Enforcement of candidate key uniqueness is optional ? Enforcement of entity integrity is optional ? Referential integrity is not enforced


Can a Structure contain a Pointer to itself?

Yes, it is quite common. Example: struct List { struct List *Next; int value; } typedef struct List List; Example2: typedef struct Tree Tree; struct Tree { Tree *left,*right; int value; };


What is data structure why is an array called a data structure which are the other data structures?

A data structure is a collection of more than one elementary item, in some kind of aggregate organization. An array is a type of structure where more than one item of the same type are arranged serially in memory, and accessed using an index. The item can either be an elementary type or it itself can be a structure type. A struct (not to be confused with the use of "structure" in this answer) is a type of structure where more than one item of the same or different types are arranged serially in memory, and accessed using the structure member (.) operator. A union is similar to a struct, except that each member occupies the same address. This means that only one type of data can be stored at any one time in a union. A self-referential structure is a type of structure, usually constructed of simpler structures, linked together with some kind of pointer scheme. Examples of this are the linked list and tree.


Advantage and disadvantage of linked list?

Linked list is a dynamic data structure that contains a "link" to the structure containing the next item. It is a collection of structures ordered not by their physical placement in memory (like array) but by logical links that are stored as part of the data in the structure itself.Advantages of Linked Lists- Dynamic structure (Mem. Allocated at run-time).- We can have more than one datatype.- Re-arrange of linked list is easy (Insertion-Deletion).- It doesn't waste memory.Disadvantages of Linked Lists- In linked list, if we want to access any node it is difficult.- It is occupying more memory.

Related questions

What is self referential function in c plus plus?

A self-referential function in C++, or in any other supporting language, is a recursive function.


What a structure must include if it is a self -referential structure in C programming?

Pointer, eg: struct Person { struct Person *father, *mother, *spouse; int age; char *name; };


Do you ever have an answer?

As an example in self-referential paradox, the answer is NO!


How do you use self referential structure?

Like any other structure. Example:typedef struct Example {struct Example *next;} Example;Example e1, e2;e1.next= &e2;e2.next= NULL;


What is referential class in c?

C is not an object-oriented language so it doesn't have classes of have any kind, it only has types. However, a self-referential type is simply a type that refers to itself. Nodes in a linked list are self-referential types because they hold a reference (a pointer) to the next node in the list: typedef struct node {node* next;/* ... */};


What is contextual criticism?

A form of criticism which views the literary text as a self-contained verbal structure. Akin to the New_Criticism, contextualism holds that a work of art generates self-referential meanings within its own internal and autonomous context. Its proponents include Cleanth Brooks, Eliseo Vivas, and Murray Krieger.


What is the difference between a shell structure and a frame structure?

A shell structure supports its self and a frame structure does not support it self.


What is autopoiesis?

Autopoiesis is a term coined by biologists Humberto Maturana and Francisco Varela to describe the self-organizing nature of living systems. It refers to the ability of an organism to continuously self-produce and self-maintain its organization through interactions with its environment. In essence, autopoietic systems are self-referential and self-sustaining.


Write a program to implement domain and referential integrity?

give me the program which can related on domain and referential integrity.


How is the data structure of system R different from the relation structure?

Unlike Relational systems in System R ? Domains are not supported ? Enforcement of candidate key uniqueness is optional ? Enforcement of entity integrity is optional ? Referential integrity is not enforced


Which of the following is not an example of metafiction breaking the fourth wall or self referential writing all of which typify postmodern writing?

A detective novel featuring a straightforward linear plot and traditional storytelling techniques would not be an example of metafiction breaking the fourth wall or self-referential writing commonly found in postmodern writing.


What does that's so meta mean?

&quot;That's so meta&quot; refers to something that is self-referential or self-aware in a clever or ironic way. It often involves commenting on the nature of the thing itself within the thing itself.