Skip to content

Tag Archives: rotation

Given an array, cyclically rotate the array clockwise by one.  Examples:   Input: arr[] = {1, 2, 3, 4, 5} Output: arr[] = {5, 1, 2,… Read More
Given a singly linked list, The task is to rotate the linked list counter-clockwise by k nodes. Examples: Input: linked list = 10->20->30->40->50->60, k =… Read More
Given an image, how will you turn it by 90 degrees? A vague question. Minimize the browser and try your solution before going further. An image can… Read More
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? (eg given s1 = ABCD… Read More
Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements.  Rotation of the above array by 2 will make an… Read More
Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements. Example: Input: arr[] = [1, 2, 3, 4, 5, 6,… Read More
Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements. Example : Input : arr[] = [1, 2, 3, 4,… Read More
  Given an array arr[] of size N, the task is to rotate the array by d position to the left. Examples:  Input:  arr[] =… Read More
Given an array of integers arr[] of size N and an integer, the task is to rotate the array elements to the left by d… Read More
Bit Rotation: A rotation (or circular shift) is an operation similar to shift except that the bits that fall off at one end are put… Read More
Given a string s1 and a string s2, write a function to check whether s2 is a rotation of s1.  Examples:  Input: S1 = ABCD,… Read More

Start Your Coding Journey Now!