Author: NIRAJ AHER

program for Reverse String in java

program for Reverse String in java

/* Program to perform reverse string operation using CharAt method*/ class reverse_string { public static void main(String args[ ]) { String reverse_string1 = “HOTJAVA”; StringBuffer reverse_string2 = new StringBuffer(); int i,j,len = reverse_string1.length(); System.out.println(“Original String is...

factorial program in java

factorial program in java

/*Program to calculate factorial of given number*/ factorial formula n!=1 * 2 * 3 * 4 ……….(n-1) * n for example factorial of  1! = 1 factorial of  2! = 1—2 = 2 factorial...

Merge sort in java

Merge Sort program in Java

Merge Sort: Merge sort is based on the divide and conquer technique. In merge sort unsorted array is divided in half again and again ,until each array contain 1 element. Divided list are merged...

Bubble sort in java

Bubble Sort program in Java

Bubble sort: It is one of the simplest sorting algorithm.In bubble sort each and every element is compared with its adjacent element and swap if at wrong place diagram below shows the working of...