#
java programs Archive

In this post, we will see how to remove all white spaces from String in java. There are multiple ways to remove spaces from String. Using ReplaceAll Using Iteration Using ReplaceAll : You can simply …

Fibonacci series is numerical series in which next number is sum of previous two numbers. For example : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. There are two ways to …

Armstrong number is a 3 digit number which is equal to sum of cube of its digits. For example: 371,153 In this post, we will see how to check for Armstrong number in java. …

In this post, we will see how to swap two numbers without using temporary variables. There are three ways to do it. Java program: When you run above program, you will get following output: …

In this post, we will see how to find Greatest common divisor(GCD) and Least Common Multiple(LCM) in java. GCD is calculated using Euclidean algorithm and LCM is calculated using reduction by GCD Eucid algo for …

If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we will see how to find transpose of matrix in java. Transpose of …

Given array of integers, find Maximum difference between two elements such that larger element appears after the smaller number For example: Algorithm: Lets say we have array arr of stock prices. We will track two variable :minElementTillNow and maxDifference. …

If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. Given an array of integers representing stock price on single day, find max profit that can …

If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. Problem: You are given arrival and departure time of trains reaching to a particular station. You …

If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. If you want to practice data structure and algorithm programs, you can go through data structure and …