In DLL, the traversal can be done using the previous node link or the next node link. The DLL occupies more memory than SLL as it has 3 fields.Ĭomplexity of insertion and deletion at a given position is O. The SLL occupies less memory than DLL as it has only 2 fields. Thus traversal is possible in both directions. Thus traversal is possible in one direction only. In SLL, the traversal can be done using the next node link only. SLL nodes contains 2 field -data field and next link field.ĭLL nodes contains 3 fields -data field, a previous link field and a next link field. Introduction to Doubly linked list : A Doubly Linked List contains an extra pointer, typically called previous pointer, together with next pointer and data which are there in singly linked list. Basically the ‘link’ field stores the address of the next node. The ‘data’ field stores actual piece of information and ‘link’ field is used to point to next node. Introduction to Singly linked list : A singly linked list is a set of nodes where each node has two fields ‘data’ and ‘link’. So, to know about the linked list, click on the link given below: Before knowing about the types of a linked list, we should know what is linked list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |