Docsity

SINGLY LINKED LIST IN DETAILS ALONG WITH CODE, Slides of Data Structures and Algorithms

Partial preview of the text

Download SINGLY LINKED LIST IN DETAILS ALONG WITH CODE and more Slides Data Structures and Algorithms in PDF only on Docsity!

Data Structure & Algorithms

Lecture 2

Linked List

Definition - List

• A list is a collection of items that has a

particular order

– It can have an arbitrary length

– Objects / elements can be inserted or

removed at arbitrary locations in the list

– A list can be traversed in order one item at a

time

Introduction to Linked Lists

Introduction to Linked Lists

Introduction to Linked Lists

Adding node at the Beginning

Adding node at the Beginning

Adding node at the Middle

Delete a node at nth position

1. Fix the links

2. Free the space