Rearrange linked list in a 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.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven 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.
Given a linked list, move its last node to the front. For example, list {1, 2, 3, 4} should be changed to {4, 1, 2, 3}.
Given a linked list, check if it is a palindrome or not.
Given a linked list, rearrange linked list nodes in a specific way in linear time and constant space. The alternate positions in the output list should be filled with nodes starting from the beginning and end of the original list.
Given a linked list and two positive integers, m and n, delete every n nodes after skipping m nodes.
Write a function that takes two lists, each of which is sorted in increasing order, and merges the two into one list, which is in decreasing order, and returns it. In other words, merge two sorted linked lists from their end.
Given two linked lists, merge their nodes into the first list by taking nodes alternately between the two lists. If the first list runs out, the remaining nodes of the second list should not be moved.
Given a linked list and a positive integer k, find the k’th node from the end of the list.
Given a linked list, reverse every adjacent group of k nodes where k is a given positive integer.
This post will reverse the linked list using recursion in C, C++, Java, and Python.
In this post, we will see how to reverse the linked list iteratively without using recursion.
Given two lists sorted in increasing order, create and return a new list representing the two lists’ intersection. The new list should be made with its memory β the original lists should not be changed.