# Tag Archives: rotation

## Rotate a Matrix by 180 degreeNovember 12, 2017

Given a square matrix the task is that we turn it by 180 degrees in anti-clockwise direction without using any extra space. Examples: Input :… Read More »

## Minimum move to end operations to make all strings equalOctober 30, 2017

Given n strings that are permutations of each other. We need to make all strings same with an operation that takes front character of any… Read More »

## Sort a Rotated Sorted ArrayOctober 11, 2017

You are given a rotated sorted array and your aim is to restore its original sort in place. Expected to use O(1) extra space and… Read More »

## Count rotations in sorted and rotated linked listSeptember 26, 2017

Given a linked list of n nodes which is first sorted, then rotated by k elements. Find the value of k. Recommended: Please try your… Read More »

## Find element at given index after a number of rotationsSeptember 24, 2017

An array consisting of N integers is given. There are several Right Circular Rotations of range[L..R] that we perform. After performing these rotations, we need… Read More »

## Split the array and add the first part to the end

There is a given an array and split it from a specified position, and move the first part of array add to the end. Examples:… Read More »

## Rotate Linked List block wiseSeptember 20, 2017

Given a Linked List of length n and block length k rotate in circular manner towards right/left each block by a number d. If d… Read More »

## Print left rotation of array in O(n) time and O(1) spaceJuly 30, 2017

Given an array of size n and multiple values around which we need to left rotate the array. How to quickly print multiple left rotations?… Read More »

## Minimum rotations required to get the same stringJuly 17, 2017

Given a string, we need to find the minimum number of rotations required to get the same string. Examples: Input : s = “geeks” Output… Read More »

## Quickly find multiple left rotations of an array | Set 1July 4, 2017

Given an array of size n and multiple values around which we need to left rotate the array. How to quickly find multiple left rotations?… Read More »

## Lexicographically smallest rotated sequence | Set 2July 1, 2017

Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD Input Constraint: 1 < n… Read More »

## Check if two numbers are bit rotations of each other or notJune 11, 2017

Given two positive integers x and y, check if one integer is obtained by rotating bits of other. Input constraint: 0 < x, y <… Read More »

## Left Rotation and Right Rotation of a StringMay 15, 2017

Given a string of size n, write functions to perform following operations on string. Left (Or anticlockwise) rotate the given string by d elements (where… Read More »

## Count rotations divisible by 4March 28, 2017

Given a large positive number as string, count all rotations of the given number which are divisible by 4. Examples: Input: 8 Output: 1 Input:… Read More »

## Check if a string can be obtained by rotating another string 2 placesMarch 16, 2017

Given two strings, the task is to find if a string can be obtained by rotating another string two places. Examples: Input : string1 =… Read More »