Skip to content

Category Archives: Java Programs

Given an array, find the least frequent element in it. If there are multiple elements that appear least number of times, print any one of… Read More
Given a string str, the task is to perform the following type of queries on the given string:   (1, K): Left rotate the string by… Read More
Given an integer n, the task is to generate all the left shift numbers possible. A left shift number is a number that is generated… Read More
We have a sorted array with duplicate elements and we have to find the index of last duplicate element and print index of it and… Read More
Given a matrix of order m*n then the task is to find the frequency of even and odd numbers in matrix Examples:   Input : m =… Read More
Given two sorted lists, merge them so as to produce a combined sorted list (without using extra space).Examples: Input: head1: 5->7->9 head2: 4->6->8 Output: 4->5->6->7->8->9… Read More
Given a string S containing lowercase English alphabets, and a matrix shift[][] consisting of pairs of the form{direction, amount}, where the direction can be 0… Read More
Given an array of n integers, find the third largest element. All the elements in the array are distinct integers. Example :   Input: arr[] = {1,… Read More
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put… Read More
Given a matrix, clockwise rotate elements in it. Examples: Input 1 2 3 4 5 6 7 8 9 Output: 4 1 2 7 5… Read More
Given a value N, if we want to make change for N cents, and we have infinite supply of each of S = { S1,… Read More
Given a linked list where every node represents a linked list and contains two pointers of its type:  Pointer to next node in the main… Read More
Given string str, the task is to find the minimum number of characters to be inserted to convert it to a palindrome. Before we go… Read More
Given a singly linked list, Your task is to remove every K-th node of the linked list. Assume that K is always less than or… Read More

Start Your Coding Journey Now!