Member-only story

Linked Lists and LL Algorithms in Swift

Chain it up in Swift

Steven Curtis
4 min readJul 24, 2023
Photo by Markus Spiske on Unsplash

This article is about the implementation of linked lists in Swift. The theory is covered in my own article.

Difficulty: Beginner | Easy | Normal | Challenging

Prerequisites:

  • Coding in Swift Playgrounds (guide HERE)
  • While loops in Swift (guide HERE)

Terminology

Swift terminology

Class: An object that defines properties and methods in common

Linked List Terminology

Data structure: A way of formatting data

Head: The first (or parent, or root) node

Linked List: A linear collection of data elements, made up of a head node with zero or more connected nodes. The order of this list is given by pointers from each node to the next

Node: The basic unit of a data structure

Null Pointer: A pointer that does not point to anywhere

Pointer: An object that stores a memory address

Tail: The linked list, after the head

Implementing a Node in Swift -Integer

--

--

No responses yet