# Category: Array

## Right rotate an array k times

In this post, we will see how to right rotate an array by specified positions. For example, right rotating the array { 1, 2, 3, 4, 5, 6, 7 } three times will result in the array { 5, 6, 7, 1, 2, 3, 4 }.

## Left rotate an array in C

In this post, we will see how to left rotate an array by specified positions. For example, left rotating the array { 1, 2, 3, 4, 5 } twice results in the array { 3, 4, 5, 1, 2 }.

## Find minimum moves required for converting a given array to an array of zeroes

Find the minimum number of moves required for converting an array of zeroes to a given array using only increment and double operations. The increment operation increases the value of an element in the array by 1 and the double operation doubles the value of each element in the array.

## Find Missing Term in a Sequence in log(n) time

Given a sequence of numbers such that the difference between the consecutive terms is constant, find missing term in it in O(log(n)) time.

## Find subarrays with given sum in an array

Given an array of integers, find subarrays with given sum in it.

## Difference between Arrays and Collections in Java

In this post, we will discuss the difference between Arrays and Collections in Java.

## Print all distinct Subsets of a given Set

Given a set S, generate all distinct subsets of it i.e., find distinct power set of set S. A power set of any set S is the set of all subsets of S, including the empty set and S itself.

## Find Floor and Ceil of a number in a sorted array (Recursive solution)

Given a sorted array of integers, find floor and ceil of a given number in it. The floor and ceiling map the given number to the largest previous or the smallest following integer, respectively.

## Set both elements of a binary array to 0 in single line

Given an binary array of size two having alteast one element as zero, write a single line function to set both its elements to zero. Use of ternary operator and direct assignment of elements are not allowed.

## K-Partition Problem | Printing all Partitions

In k-partition problem, we need to partition an array of positive integers into k disjoint subsets that all have equal sum and they completely covers the set.

## 3-Partition Problem

3-partition problem: Given a set S of positive integers, determine if it can be partitioned into three disjoint subsets that all have same sum and they cover S.

## Iterative Merge Sort Algorithm (Bottom-up Merge Sort)

In this post, we will see how to sort an array of integers using iterative merge sort algorithm.