# Tag Archives: Reverse

## Print words of a string in reverse orderNovember 4, 2017

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 »

## Reverse a sublist of linked listOctober 14, 2017

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 »

## Find element at given index after given range reversalsSeptember 28, 2017

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 »

## Reverse an array without using subtract sign ‘-‘ anywhere in the codeMay 21, 2017

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 »

## Minimum edges to reverse to make path from a source to a destinationNovember 11, 2016

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 »

## Collections.reverse() in Java with ExamplesNovember 1, 2016

java.util.Collections.reverse() method is a java.util.Collections class method. It reverses the order of elements in a list passed as an argument. // Reverses elements of myList… Read More »

## Reverse and Add FunctionAugust 30, 2016

The reverse and add function starts with a number, reverses its digits, and adds the reverse to the original. If the sum is not a… Read More »

## Reverse an array in groups of given size | Set 2 (Variations of Set 1 )August 23, 2016

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… Read More »

## Reverse an array in groups of given sizeAugust 18, 2016

Given an array, reverse every sub-array formed by consecutive k elements. Examples: Input: arr = [1, 2, 3, 4, 5, 6, 7, 8, 9] k… Read More »

## Different methods to reverse a string in C/C++April 20, 2016

Here, we are discussing some of the methods to reverse strings in C++: Write own reverse function by swapping characters: One simple solution is two… Read More »

## Merge two sorted linked lists such that merged list is in reverse orderDecember 1, 2015

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 »

## Reverse an array without affecting special charactersOctober 27, 2015

Given a string, that contains special character together with alphabets (‘a’ to ‘z’ and ‘A’ to ‘Z’), reverse the string in a way that special… Read More »

## Reverse an array upto a given positionAugust 9, 2015

Given an array arr[] and a position in array, k. Write a function name reverse (a[], k) such that it reverses subarray arr[0..k-1]. Extra space… Read More »

## Reverse alternate levels of a perfect binary treeJune 29, 2014

Given a Perfect Binary Tree, reverse the alternate level nodes of the binary tree.