Linked Lists

Sejan Miah
Aug 9, 2017 · 2 min read

A linked list contains ordered items, where each item is a node. There are single linked lists, where each node only has a reference to the next node. Then there is the doubly linked list, where each node references the previous node and the next node. The head node is the first node in your linked list, whereas the tail is the last node.

When thinking about the run time of a linked list, let’s think about it’s basic structure. It’s very easy for us to insert or delete a node because we have access to a head/tail — O(1), but when it comes to searching through or accessing a node it’s much slower, similar to an array O(n).

killingMeSwiftly

My experience learning iOS

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade