Check if a linked list is palindrome or not
Given a linked list, check if it is a palindrome or not.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven 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.
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, reverse every adjacent group of k nodes where k is a given positive integer.
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.
Write a function that takes two lists, each of which is sorted in increasing order, and merges the two into a single list in increasing order, and returns it.
Given a linked list, split it into two lists containing alternating elements from the original list. The elements in the new lists may be in any order.
Rearrange a given linked list such that every even node will be moved to the end of the list in reverse order.
Given a linked list, write a function to rearrange its nodes to be sorted in increasing order.
The longest alternating subsequence is a problem of finding a subsequence of a given sequence in which the elements are in alternating order and in which the sequence is as long as possible.