Self Referential Structure

  • A self referential Structure is a structure which has a member which points to the same structure. This type of structure is called as self referential block
  • When structure member can points to itself then this type of structure is called as Self Referential Structure
  • Self Referential Structure are Used in data structures like Linked List ,Queues, doubly linked list, etc.
  • Learning basic of self-referential structure now ,is very good thing, because you are learning basic for data structures
  • let's see how you can make Self Referential Structure

We will define a structure Link which will have link number and pointer of structure Link data type as it's member.

defining:Structure Link
struct link
{
    int link_no; //member1
    
    struct link  *links //member2
    //*links is pointer of structure link data type
    //which will point to structure link.
};

let's see structure link visually



  • Pointer Links is pointer which is pointing to the structure link that is why it is making a another block of structure link
  • It will make a block of structure link untill the pointer links will stop to point link structure.
  • This is how Self Referential Structure works.
  • This Self Referential Structure are used in data structure to make structures like linked list ,stack, etc.
  • So ,try do more practice on Self Referential Structure for having good understanding in building structures like linked list ,stack, etc.






Further Concept:


People Also Searched: