![]() The last node in the list is identified by the null pointer which is present in the address part of the last node. The data part of every node contains the marks obtained by the student in the different subject. In the above figure, the arrow represents the links. In other words, we can say that each node contains only next pointer, therefore we can not traverse the list in the reverse direction.Ĭonsider an example where the marks obtained by the student in three subjects are stored in a linked list as shown in the figure. ![]() One way chain or singly linked list can be traversed only in one direction. Data part of the node stores actual information that is to be represented by the node while the link part of the node stores the address of its immediate successor. A node in the singly linked list consist of two parts: data part and link part. The number of elements may vary according to need of the program. Singly linked list can be defined as the collection of ordered set of elements. List grows as per the program's demand and limited to the available memory space. Sizing is no longer a problem since we do not need to define its size at the time of declaration.All the nodes of linked list are non-contiguously stored in the memory and linked together with the help of pointers. Linked list is the data structure which can overcome all the limitations of an array. Inserting any element in the array needs shifting of all its predecessors. All the elements in the array need to be contiguously stored in the memory.It is almost impossible to expand the size of the array at run time. Increasing size of the array is a time taking process. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |