Code Skiller logoCB Logo
Logo LearnLearnLogo PracticePracticeLogo HireHireLogo IDEIDE

LINKED LISTS

In this topic we learn how to store data in a non-contiguous manner and we understand how the Linked List can work in a better time complexity that other data structures in some operations.

Introduction to Linked Lists

What is a Linked List?

A linked list is a linear data structure that consists of a sequence of connected nodes, where each node contains a value and the address of the next node.

  • Pointers are used to connect the consecutive nodes.
  • The firs...
Read more

Applications, Advantages and Disadvantages of Linked Lists

Real-world applications of linked list

Linked lists have many practical applications in the real world. Here are a few examples:

  1. Text editors: Text editors often use linked lists to implement their undo/redo functionality. A new node indi...
Read more

Types of linked list

Singly linked list: A singly linked list is a linear data structure that consists of a sequence of nodes, each containing a value and a pointer pointing to the next node in the sequence.

  • The first node in the list is called the head node, and ...
Read more

Linked list vs array

Definitions:

Arrays: An array is a collection of similar data elements stored in contiguous memory locations and accessed by a common name or index. The elements in an array can be of any data type, such as integers, characters, or even other...

Read more

Singly linked list

Definition:

A singly linked list is a linear data structure that consists of a sequence of nodes, each containing a value and a pointer pointing to the next node in the sequence.

...

Read more

Doubly linked list

Definition: : A doubly linked list is a linear data structure that is similar to a singly linked list, but each node has a value and two pointers: one to the next node and one to the previous node.

Diagram: ![](https://images.codingblocks.c...

Read more

Linked List Cycle

Detect a cycle-

Using Floyd’s Cycle-Finding method- This algorithm is used to find a cycle/loop in a linked list. Two pointers, slow and fast are used in this algorithm.

**Algorith...

Read more

Sorting Algorithms on Linked Lists

Bubble sort: In this sorting algorithm, adjacent nodes are compared and swapped if they are in wrong order.

Singly linked list:

Algorithm:

  • Create a boolean variable swapped ...
Read more

Standard Template Library

The C++ Standard Template Library (STL) provides the ‘list’ container, which is a doubly-linked list implementation.

It offers several member functions to manipulate and access elements in the list.

1. Creating a list: Used to create an empty ...

Read more

Library

WEB DEVELOPMENT

FAANG QUESTIONS