Posts from Java

Lucky Seven Problem in Java

By Saurabh Singh

In this Java tutorial, we will learn how to solve lucky seven problem in Java. We will also take a look at the code snippet with the output. Problem Statement – Solve Lucky S.... Read More

How to Count leaf nodes in a binary tree using Recursion in Java

By vikrant_tomar

In this post, we will write a Java program to count the leaf nodes in a binary tree. We will use recursion to solve this problem. In a binary tree, each node can have at most two.... Read More

String to Integer and Integer to String conversion in Java

By divyesh srivastava

In this Java tutorial, we are going to learn how to convert string to integer and integer to string using pre-defined functions in Java. So in the same tutorial post we will see ho.... Read More

Swap two strings with using substring( ) function in Java

By divyesh srivastava

In this Java tutorial, we are going to swap two strings using pre-defined substring() function in Java. What is substring() in Java? substring() method in Java operates in two ways.... Read More

Print Pattern – Codechef December Lunchtime 2018 Problem in Java

By divyesh srivastava

Problem Statement We are provided with an integer N. We have to print the N*N pattern like consider the following 4×4 pattern: 1 2 4 7 3 5 8 11 6 9 12 14 10 13 15 16 Algorithm to .... Read More

Tower of Hanoi Problem using recursion in Java

By divyesh srivastava

In this Java tutorial, we are going to discuss the famous Tower of Hanoi problem using ‘n’ disks. We are going to solve it using recursive function calling approach. Wh.... Read More

Segregating ‘R’ ‘G’ ‘B’ in a string in Java

By divyesh srivastava

In this Java tutorial, we will learn how to segregate R G B in a string in Java. You will find easy to understand algorithm with an easy code snippet. Input and output are also pro.... Read More

Find the Closest distance between a pair of point among given n points in Java

By Saurabh Singh

In this Java tutorial, we are going to learn how to find the smallest distance between a pair of points in presence of many other points. Problem statement: Find the closest distan.... Read More