# Category: Linked List

## ArrayList vs LinkedList in Java

In this post, we will discuss the differences between ArrayList and LinkedList in Java.

## Sort linked list containing 0’s, 1’s and 2’s in single traversal

Given a linked list containing 0’s, 1’s and 2’s, sort linked list by doing single traversal of it.

## Linked List Implementation in C++

This post provides an overview of some of the available techniques to implement a linked list in C++ programming language.

## Calculate height of a binary tree with leaf nodes forming a circular doubly linked list

Write an algorithm to compute the height of a binary tree with leaf nodes forming a circular doubly linked list where the left and right pointers of the leaf node will act as a previous and next pointer of circular doubly linked list respectively.   For example, consider below binary tree. The leaf nodes are …

## Find Vertical Sum in a given Binary Tree

Given a binary tree, print vertical sum of it. Assume, the left and right child of a node makes 45 degree angle with the parent.

## Detect Cycle in a linked list (Floyd’s Cycle Detection Algorithm)

In this post, we will see how to detect cycle in a a linked list using Hashing and Floyd’s Cycle Detection Algorithm.

## Rearrange the linked list in specific manner

Given a linked list, split it into two lists where each list contains alternating elements from the original list and then finally join them back together.

## Move last node to front in a given Linked List

Given a linked list, move its last node to front.

## Check if a Linked List is Palindrome or not

Given a linked list, check if linked list is palindrome or not.

## Rearrange linked list in specific manner in linear time

Given a linked list, rearrange linked list nodes in specific way in linear time and constant space. The alternate positions in the output list should be filled with the nodes starting from the beginning and from the very end of the original list respectively.

## Delete every N nodes in a linked list after skipping M nodes

Given a linked list and two positive integers M and N, delete every N nodes in it after skipping M nodes.

## Merge two sorted linked lists from their end

Write a function that takes two lists, each of which is sorted in increasing order, and merges the two together into one list which is in decreasing order and return it. In other words, merge two sorted linked lists from their end.