Linked Lists Linked List Basics: Student - Feedback@sti - Edu
Linked Lists Linked List Basics: Student - Feedback@sti - Edu
Linked Lists It can grow and shrink The array size is specified
during program execution. during declaration.
Linked List Basics The position of the elements The position of the elements
• A linked list is used for storing a collection of data where each is allocated during runtime. is allocated during
element is a separate object. compilation.
• Elements in a linked list are called nodes. Elements are sequentially Elements are randomly
• The parts of a node are the following: accessed. accessed.
Data Pointer It utilizes memory efficiently. Memory utilization is
o Data field – This contains the value of the element. ineffective.
o Pointer field (link or reference) – This contains the
address (random memory location) of the next node. Types of Linked List
• The next node in the list is referred to as the successor. • Singly linked list – the basic linked list
• The first node in the list is called head. • Doubly linked list – contains an extra pointer to connect to
• The last node points to null since there are no more the previous node in the sequence. The left pointer contains
successive elements. the address of the preceding node called “predecessor.”
Left Pointer Data Right Pointer