Skip to content

Category Archives: Java Programs

Given non-negative integers K, M, and an array arr[] with N elements find the Mth element of the array after K left rotations. Examples: Input:… Read More
Given an array arr[], the task is to find the number of rotations required to convert the given array to sorted form.Examples: Input: arr[] =… Read More
Given an integer array arr[] of size N, the task is to print all possible rotations of the array.Examples:  Input: arr[] = {1, 2, 3,… Read More
Given a matrix mat[][] of size N*N, the task is to rotate the matrix by 45 degrees and print the matrix. Examples: Input: N =… Read More
Given two arrays arr1[] and arr2[] of N integers and array arr1[] has distinct elements. The task is to find the maximum count of corresponding… Read More
Java data types can be categorized as primitive and non-primitive. Primitive data types contain a single value, whereas non-primitive data types contain an address of… Read More
Given an array arr consisting of N elements and Q queries of the following two types:   1 K: For this type of query, the array… Read More
Given an integer X and two strings S1 and S2, the task is to check that string S1 can be converted to the string S2… Read More
Given two integers N and K, the task is to rotate the digits of N by K. If K is a positive integer, left rotate… Read More
Given two linked lists that represent two large positive numbers. Subtract the smaller number from the larger one and return the difference as a linked… Read More
Given a matrix and the task is to check matrix is involutory matrix or not.  Involutory Matrix: A matrix is said to be involutory matrix… Read More
Given a linked list and two positions ‘m’ and ‘n’. The task is to rotate the sublist from position m to n, to the right… Read More
Given a N * N matrix and the task is to check matrix is idempotent matrix or not.Idempotent matrix: A matrix is said to be… Read More

Start Your Coding Journey Now!