Search⌘ K

Linked List

Explore the key concepts of linked lists including nodes, pointers, and common operations like push, pop, and find. Understand their time complexities and implement a linked list in Python. This lesson equips you with practical knowledge essential for data structures in data science interviews.

A linked list consists of links grouped in a chain. Links are nodes. Each node consists of a key (data) and a next pointer. The next pointer points to the next node in the chain.

Linked list
Linked list

List Operations

We can perform the following operations on list:

  • PushLeft: Push the data element to the left.
  • PopLeft: Extracting a data element from the left.
  • KeyLeft: Get the data element from left without removing it.
  • PushRight: Push the data element to the right.
  • PopRight: Extract the data element from the right.
  • ...