0% found this document useful (0 votes)
240 views3 pages

11 Self Referencial Structure

This document discusses self-referential structures, which allow a structure to contain a pointer to another instance of the same structure type. This allows structures to be linked together to form common data structures like linked lists, queues, and stacks. A self-referential structure contains a pointer to the same structure type and uses NULL pointers to terminate the linking between structures.

Uploaded by

pir zada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
240 views3 pages

11 Self Referencial Structure

This document discusses self-referential structures, which allow a structure to contain a pointer to another instance of the same structure type. This allows structures to be linked together to form common data structures like linked lists, queues, and stacks. A self-referential structure contains a pointer to the same structure type and uses NULL pointers to terminate the linking between structures.

Uploaded by

pir zada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Self Referential Structures

 It is used to create the Dynamic data structures


linked lists, queues, stacks and trees etc.
 A structure cannot contain an instance of itself
 However it can contain a pointer to the same
structure type
 A structure containing a pointer to the same
structure type is known as the Self Referential
Structure.
Self-Referential Structures
 Self-referential structures
 Structure that contains a pointer to a structure of the same type
 Can be linked together to form useful data structures such as lists,
queues, stacks and trees
 Terminated with a NULL pointer (0)

 Two self-referential structure objects linked together


15 10

Data member
and pointer NULL pointer (points to nothing)
Self-Referential Classes
struct node {
int data;
struct node *nextPtr;
}
 nextPtr - points to an object of type node

 Referred to as a link – ties one node to another node

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy