Programming

Sort String

Sort String Programmatically in Java Program 1 : Java Program to sort a string without using inbuilt sort() method Program 2 : Java Program to sort a string without using sort() method Program 3 : Java Program to sort a string without using Arrays.sort(T [ ], Comparator c) method

Sort String Read More »

Palindrome

Palindrome String A string is said to be palindrome if it is the same from both the ends. For example : malayalam,rotor,civic,etc Program 1 : Check Whether String is Palindrome (Using Reverse String) Program 2 : Check Whether String is Palindrome (Using Two Pointer) Program 3 : Check Whether String is Palindrome (Using Recursion) Program

Palindrome Read More »

Anagram String

Anagram String What is Anagram String ? Two strings are said to be anagram if they contain the same characters even though order of characters may be different. For example read and dare,eat and tea,fear and fare and so on Program 1 : Java Program To Check Whether Two Strings Are Two Strings Are Anagram

Anagram String Read More »

Reverse String

Reversing A String Programmatically Program 1 : Program to Reverse a String (Method – 1 Using for loop) Program 2 : Program to Reverse a String (Method – 2 Using String.getBytes() Method) Program 3 : Program to Reverse a String (Method – 3 Using StringBuilder.reverse() Method) Program 4 : Program to Reverse a String (Method

Reverse String Read More »

Insert String

Inserting New String Into Existing String Program 1 : Java Program to insert String into another String (Method 1) Program 2 : Java Program to insert String into another String (Method 2 : Using String.substring()) Program 3 : Java Program to insert String into another String (Method 3 : Using StringBuffer.insert())

Insert String Read More »

Heap Sort

Heap Sort in Java Heap sort is a comparison-based sorting technique which is based on Binary Heap Data Structure. Heap Sort is an optimization of selection sort where we first find the max (or min) element swapping it with the last (or first). and we repeat the same process for the remaining elements. In Heap

Heap Sort Read More »

Merge Sort

Merge Sort in Java The merge sort is a divide and conquer algorithm that divides the input array into equal subarrays and then merges back those subarrays into a sorted array. The process of merge sort is to divide the array into two equal subarrays, sort each subarray, and then merge the sorted subarrays back

Merge Sort Read More »

Quick Sort

Quick Sort in Java Quicksort algorithm is based on the divide and conquer approach where an array is divided into subarrays by selecting a pivot element.The pivot element is positioned in such a way that elements less than pivot are kept on the left side and elements greater than pivot are on the right side.The

Quick Sort Read More »

Scroll to Top