Linked Lists

Sejan Miah
killingMeSwiftly
Published in
2 min readAug 9, 2017

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).

--

--