0% found this document useful (0 votes)
5 views

dynamic

Self-referential structures are defined as structures that contain members pointing to variables of the same type, commonly used in dynamic data structures like trees and linked lists. An example is provided with a structure definition that includes an integer data member and a pointer to another structure of the same type. It is important to note that pointers to structures function similarly to pointers to other variable types.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

dynamic

Self-referential structures are defined as structures that contain members pointing to variables of the same type, commonly used in dynamic data structures like trees and linked lists. An example is provided with a structure definition that includes an integer data member and a pointer to another structure of the same type. It is important to note that pointers to structures function similarly to pointers to other variable types.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Self Referential Structures

A structure can have members which point to a structure variable


of the same type.

These types of structures are called self referential structures and
are widely used in dynamic data structures like trees, linked list,
etc.

The following is a definition of a self referential structure.


struct node
{
int data; Here, next is a pointer to a struct
struct node *next; node variable.
};
It should be remembered that a pointer to a structure is
similar to a pointer to any other variable.

A self referential data structure is essentially a structure


definition which includes at least one member that is a
pointer to the structure of its own kind.

You might also like