# Category Archives: Java Programs

Given two permutations P1 and P2 of numbers from 1 to N, the task is to find the maximum count of corresponding same elements inâ€¦ Read More
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
Given an array of n elements. Our task is to write a program to rearrange the array such that elements at even positions are greaterâ€¦ Read More
Given a square matrix mat[][] of dimension N and an integer K, the task is to rotate the matrix by 90 degrees K times withoutâ€¦ Read More
Given a linked list and a number n. Find the sum of the last n nodes of the linked list.Constraints: 0 <= n <= numberâ€¦ Read More
Given two strings s1 and s2, find if s1 is a substring of s2. If yes, return the index of the first occurrence, else returnâ€¦ Read More
Given an array of positive integers. We are required to write a program to print the minimum product of any two numbers of the givenâ€¦ Read More
Introduction to Identity Matrix :  The dictionary definition of an Identity Matrix is a square matrix in which all the elements of the principal orâ€¦ Read More
Given a linked list containing n nodes. The problem is to insert a new node with data x at the middle of the list. Ifâ€¦ Read More
Given an array a, we have to find the minimum product possible with the subset of elements present in the array. The minimum product canâ€¦ Read More
Given a singly linked list, find middle of the linked list and set middle node of the linked list at beginning of the linked list. Examples:â€¦ Read More
Given two sorted arrays of distinct elements, we need to print those elements from both arrays that are not common. The output should be printedâ€¦ Read More
Given a sorted array of distinct positive integers, print all triplets that form AP (or Arithmetic Progression)Examples :Â Â  Input : arr[] = { 2, 6,â€¦ Read More
Given a singly linked list and an integer K, the task is to rotate the linked list clockwise to the right by K places.Examples:   Input:â€¦ Read More
Given an array arr[] consisting of N positive integers, the task is to rotate the digits of array elements in an anti-clockwise direction such thatâ€¦ Read More