LINKED LISTS
DEFINITION A LINKED LIST IS A SEQUENCE OF NODES CONNECTED TO EACH OTHER USING POINTERS.
TYPES SINGLY LINKED LIST DOUBLY LINKED LIST CIRCULARLY LINKED LIST
WHAT IS A NODE FIELD1 FIELD2 A NODE IS A STRUCTURE THAT CONTAINS ONE OR MORE FIELDS ALONG WITH A FIELD TO HOLD THE REFERENCE TO THE NEXT NODE FIELD1 FIELD2 FIELD3 FIELD4 LINK
CREATING A LIST CREATE A NODE. CALL IT HEAD NODE EVERY TIME YOU WANT TO ADD NODES DO THE FOLLOWING: CREATE A NODE ADD A LINK TO THE NEW NODE FROM THE LAST NODE CREATED
LIST CREATION DATA DATA LINK HEAD NODE LINK DATA DATA LINK LINK DATA
DELETING A NODE IN THE MIDDLE DATA DATA LINK HEAD NODE LINK DATA DATA
DELETING A NODE AT THE END DATA DATA LINK HEAD NODE LINK DATA DATA
DELETING A NODE DELETE HEAD DATA DATA LINK HEAD NODE LINK DATA DATA
INSERTING A NODE HEAD NODE DATA LINK DATA LINK DATA LINK DATA LINK
DOUBLY LINKED LIST CONTAINS NODES WITH TWO LINK FIELDS – ONE TO PREVIOUS NODE AND ANOTHER TO NEXT NODE LINK TO PREV FIELD1 FIELD2 FIELD3 LINK TO NEXT
DOUBLY LINKED LIST CREATION HEAD NODE PREV DATA NEXT PREV DATA NEXT PREV DATA NEXT TAIL NODE PREV DATA NEXT PREV DATA NEXT
DELETING A NODE IN A DDL DELETE THIS NODE PREV DATA PREV HEAD NODE NEXT PREV DATA NEXT PREV DATA NEXT TAIL NODE PREV DATA NEXT PREV DATA NEXT
INSERT A NODE IN DLL INSERT HERE PREV DATA PREV PREV HEAD NODE NEXT TAIL NODE PREV DATA NEXT PREV DATA NEXT
CIRCULARLY LINKED LIST A SINGLY OR DOUBLY LINKED LIST WHERE THE TAIL NODE IS CONNECTED TO THE HEAD NODE IS CALLED A CIRCULARLY LINKED LIST
CIRCULARLY LINKED LIST CREATION HEAD NODE PREV DATA NEXT PREV DATA NEXT PREV DATA NEXT TAIL NODE PREV DATA NEXT PREV DATA NEXT
INSERTION / DELETION IN CLL SIMILAR TO THE PREVIOUS TWO TYPES. CARE MUST BE TAKEN WHEN HEAD OR TAIL GETS DELETED. SOMETIMES THERE IS NO DISTINCTION AS TO HEAD OR TAIL NODE
THANK YOU