Data Structures and Algorithms Basics

Implementation of Linked List in C++

Everything you need to know to implement a basic Linked List in C Plus Plus Language

Sharad Ghimire
The Startup
Published in
6 min readApr 16, 2020

--

A Linked List is a list that is made out of linking nodes together. If these words are unfamiliar, don’t worry, we will start with basics so they will be explained as we go along this article. The first step in understanding a more complex data structure starts with understanding much simpler one first. Let’s dive in by introducing what actually is Linked List.

Linked List

In Computer Science, a linked list is linear collection of data elements, whose order is not given by their physical placement in memory.

Above definition by Wikipedia sounds a bit vague and hard to understand. Let’s dissect it first. A List is an ordered data structure that keeps elements in a specific order. Normally, the order is determined by the insertion. And a linked list is simply a list that is built out of nodes that link to the next node and so on. Unlike an array, which is built out of a block of memory broken into chunks, it is built out of things which we generally call nodes. Think node as a box of memory that only stores two things, a data and a reference. That data can be anything from a simple int to complex things and a reference is simply a link (or a pointer…

--

--