# Blog Posts tagged with 'linkedlist'

## Reverse a Linked List is a Popular Technical Interview Question

Reversing a linked list is a popular technical interview question and one I see a lot on popular programming challenge websites. In this linked list tutorial we will create a custom LinkedList Class with a reverse method that will reverse a linked list. We will also create unit tests to test the algorithm using Python's Unit Testing Framework.

## Detect Cycle in Linked List Using Floyd's Cycle-Finding Algorithm

One popular algorithm for detecting cycles in linked lists is Floyd's Cycle-Finding Algorithm, which is often called the tortoise and the hare algorithm. The algorithm uses 2 pointers, a fast pointer and a slow pointer. The fast pointer ( hare ) traverses the linked list 2 nodes at a time while the slow pointer ( tortoise ) traverses the linked list 1 node at a time. If these pointers ever point to the same node in the linked, there is a cycle in the linked list.

## Coding a Queue Abstract Data Type using a Linked List in Python

In this tutorial I will create a Queue Abstract Data Type using a linked list in Python. The queue will implement the two most common operations of enqueue and dequeue to add and remove an item from the queue.

## Coding a Stack Abstract Data Structure Using Linked List in Python

This linked list tutorial will implement a Stack abstract data structure and use a linked list as the underlying data structure for maintain state. The developer will use common stack operations, like push, pop, and peek, and be unaware of the underlying use of a linked list and constant time, O(1), algorithms to perform the operations.