Skip to content

Category Archives: Java Programs

Given an array and a value, find if there is a triplet in array whose sum is equal to the given value. If there is… Read More
Given a string S, the task is to remove all the duplicates in the given string. Below are the different methods to remove duplicates in a… Read More
Given a set of strings, find the longest common prefix. Examples: Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”} Output : "gee" Input : {"apple", "ape", "april"} Output… Read More
Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers.Example:  … Read More
Given an array arr[] of size n. Three elements arr[i], arr[j] and arr[k] form an inversion of size 3 if a[i] > a[j] >a[k] and… Read More
Breadth First Traversal (or Search) for a graph is similar to Breadth First Traversal of a tree (See method 2 of this post). The only… Read More
Given a Singly Linked List, starting from the second node delete all alternate nodes of it. For example, if the given linked list is 1->2->3->4->5… Read More
Given two linked lists, insert nodes of the second list into the first list at alternate positions of the first list. For example, if first list… Read More
Given a linked list with a loop, the task is to find whether it is palindrome or not. You are not allowed to remove the… Read More
Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the… Read More
Before understanding how the brightness is adjusted in any image first we have to understand how an image is represented. image is represented in the… Read More
Given an array of n non-negative integers. The task is to find frequency of a particular element in the arbitrary range of array[]. The range… Read More
Given a linked list, print reverse of it using a recursive function. For example, if the given linked list is 1->2->3->4, then output should be… Read More
Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548,… Read More
Using pointers, loop through the whole list and keep track of the node prior to the node containing the last occurrence key using a special… Read More

Start Your Coding Journey Now!