Merge Sort

In this article we will learn about merge sort. Merge sort is one of the sorting technique that follows divide and conquer strategy to sort the elements. In merge sort algorithm we split the entire array into two equal parts, the sub- arrays are again continuously divided into parts until the array can not be … Read more

string palindrome in java

In this article, we are going to discuss about palindrome string and write a code in java to check whether a given string is palindrome or not. Palindrome String:- A palindrome string is a string that remains the same after reversing the string for example-“abc”, this is not a palindrome string because after reversing the … Read more

power using recursion

In this article, we are going to find power of given number using recursion in java. Example:- if num=2 and power=3, then the output will be 8. steps:- java code to calculate power using recursion:- Output:- You can use the same approach to calculate the power using recursion in other programming languages like C, C++, … Read more

Swap two numbers

In this article, we are going to swap two numbers by using two different approach. first approach is using third variable and second one is without using third variable. Swapping two numbers using third variable. In this approach, we used a temporary i.e. third variable two swaps two numbers. Here we are going to use … Read more

RabbitMQ using Spring Boot

What is RabbitMQ ? RabbitMQ is an open source message broker that implements AMQP(Advance Message Queuing Protocol). Some of the main features of RabbitMQ are Security, Asynchronous Messaging, etc. To perform message queuing we need three components: Producers: It publishes the message to the queue based on queue name. Broker: The message broker acts as … Read more

Distinct elements in array

In this article, we are going to find distinct element in array using java code. Example:- if n=5(size of ann array) arr={45,23,5,23,45}, then the output will be 3. Steps:- Java code to find distinct element in given array:- Output:- You can use same logic to find distinct element in given array using another programing language … Read more

maximum and minimum element in the array

In this article, we are going to find maximum and minimum element in the given array using java code. Example:- if n=4(size of an array) arr={48,58,5,2}, then the output will be 58 is the maximum element and 2 is the minimum element. steps:- Java code to find maximum and minimum element in an array:- Output:- … Read more

minimum element in array

In this article, we are going to find minimum element in array using java code. Example:- If n=4(size of an array) arr={5,8,9,4}, then the output will be 4. Steps:- Java code to print minimum element in array. Output:- You can use the same logic to print minimum element in an array using other programing languages … Read more