Posts by divyesh srivastava

Author Biographical Info:

Various Star Pattern Programming in Java

By divyesh srivastava

In this Java tutorial, I am going to discuss some of the star pattern programmings. Star pattern programming is generally discussed in starting when we start learning any programmi.... 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

Finding Missing number in an array using XOR operation in Java

By divyesh srivastava

In this Java tutorial, we gonna learn how to find a missing number in an array in Java using XOR operation. Problem Statement We are given an array of ‘n-1’ elements an.... Read More

Pair with a given sum in an array using HashSet in Java

By divyesh srivastava

In this Java tutorial, we are going to find the existence of a pair in an array whose sum is equal to a given value using HashSet. What is HashSet in Java? Set is an unordered coll.... Read More