Given a Doubly Linked List, we are asked to reverse the list in place without using any extra space. Examples: Input : 1 <--> 2… Read More
Tag Archives: Reverse
Given a linked list, print the reverse of it without modifying the list. Examples: Input : 1 2 3 4 5 6 Output : 6… Read More
Given a pointer to the head node of a linked list and a number K, the task is to reverse the first K nodes of… Read More
Write a program to reverse the given Doubly Linked List. See below diagrams for example. (a) Original Doubly Linked List (b) Reversed Doubly Linked List… Read More
Let there be a string say “I AM A GEEK”. So, the output should be “GEEK A AM I” . This can done in many… Read More
We are given a linked list and positions m and n. We need to reverse the linked list from position m to n. Examples: Input… Read More
An array consisting of N elements is given. There are several reversals we do in unique ranges[L..R]. The task is to print the element at… Read More
Given an array, the task is to reverse the array without using subtract sign ‘-‘ anywhere in your code. It is not tough to reverse… Read More
Given pointer to the head node of a linked list, the task is to reverse the linked list. Examples: Input : Head of following linked… Read More
Given a directed graph and a source node and destination node, we need to find how many edges we need to reverse in order to… Read More
Write a program that takes number and gives the resulting palindrome (if one exists). If it took more than 1, 000 iterations (additions) or yield… Read More
Given an array, reverse every sub-array that satisfies the given constraints.We have discussed a solution where we reverse every sub-array formed by consecutive k elements… Read More
Given an array arr[] and an integer K, the task is to reverse every subarray formed by consecutive K elements. Examples: Input: arr[] = [1, 2,… Read More
The reversing of a string is nothing but simply substituting the last element of a string to the 1st position of the string. Different Methods… Read More
Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order). Examples: Input:… Read More