Rearrange a given array of int values so that the even numbers appear first, followed by the odd numbers. Here is an example of how you might implement the orderEvenBef…
Read moreInsertion sort in Java Insertion sort is an algorithm for sorting an array by iterating through the array and inserting each element into its correct position in a sorte…
Read moreBucket Sort in Java Bucket sort is an algorithm for sorting an array of elements that are uniformly distributed across a range. It works by dividing the range into a nu…
Read moreSelection sort in Java Selection sort is an algorithm for sorting an array by repeatedly selecting the minimum element (considering ascending order) from the unsorted p…
Read moreQuick Sort in Java Quick sort is an efficient, general-purpose, comparison-based sorting algorithm. It works by selecting a "pivot" element from the array and…
Read moreMerge Sort in Java Merge sort is an efficient, general-purpose, comparison-based sorting algorithm. It works by dividing an array into two halves, sorting each half, and…
Read moreConvert it into a sorted linked list. You have to return the head of LL The first and only line of input contains data of the nodes of the tree in level order form. The…
Read moreBreadth First Search tree in Java Breadth-first search (BFS) is an algorithm for traversing or searching a graph, tree, or other data structure. It starts at the root n…
Read moreWrite a java code to find the height of a binary tree To find the height of a binary tree in Java, you can use the following recursive approach: If the tree is empty (i…
Read moreFind all possible palindromes in a String in java To find all palindromic substrings in a given string in Java, you can use the following approach: Iterate over the cha…
Read moreFinding all possible combinations of numbers to reach a given sum Java To write a Java method allCombinationsWithValue that determines all combinations of digits and op…
Read moreWrite a program to encode and decode a string in java To write a Java program that encodes and decodes a string, you can use a simple substitution cipher. In a substitut…
Read moreLongest common subsequence Program in Java To write a Java method lcs that recursively processes two strings from the back and returns the longest common suffix, you ca…
Read moreHow to search in binary sort tree in Java To search for a specific value in a binary search tree (BST), you can use a recursive or iterative approach. In a recursive ap…
Read moreSum of Binary Tree in Java To calculate the sum of all the values in a binary tree in Java, you can use a recursive traversal to visit each node in the tree and add its…
Read moreHow to take input in linked list in java To take input for a linked list in Java, you can use a loop to read in the values and create the nodes one at a time. Here is a…
Read moreIn this Blog we are going to learn how to remove Duplicate Characters from a string in java using Hashmap Code : package learningJava; import java.util.*; public class…
Read moreIn this blog, we will learn how to reverse a string in Java package learning; import java.util.Scanner; public class queueP { public static void reverse(String a) { …
Read more
Social Plugin