Home | Projects | Notes > Data Structures & Algorithms > Singly-Linked Lists

Singly-Linked Lists

 

Introduction

A singly linked list is a linear data structure made up of nodes, where each node contains a data value and a pointer to the next node in the sequence. The list is traversed in one direction — from the front to the back — by following these next pointers. It supports dynamic memory usage and is ideal for frequent insertions or deletions at known positions.

 

singly-linked-list

 

Pros:

Cons:

Compared to Arrays:

 

Implementation (C++)

Header (slist.hpp)

Source (slist.cpp)

Test Driver