AmitDiwan has Published 10744 Articles

Java program for recursive Bubble Sort

AmitDiwan

AmitDiwan

Updated on 27-Aug-2024 18:48:46

2K+ Views

In this article, we will learn to implement Bubble Sort using recursion in Java. Our goal is to understand how recursion can be applied to the Bubble Sort algorithm to achieve the same sorting effect as its iterative counterpart. Problem Statement Write a Java program to sort an ... Read More

Java program to split a list into two halves

AmitDiwan

AmitDiwan

Updated on 27-Aug-2024 18:48:06

2K+ Views

In this article, we will understand how to split a list into two halves. A list is an ordered collection that allows us to store and access elements sequentially. It contains index-based methods to insert, update, delete, and search the elements. It can also have duplicate elements. We will be ... Read More

Insert a string into another string in Java

AmitDiwan

AmitDiwan

Updated on 27-Aug-2024 18:46:59

4K+ Views

In this article, we will explore how to insert a string into another string at a specific position using Java. To do so we will be using the StringBuffer class.  StringBuffer class: StringBuffer class creates and manipulates strings that can be changed. It changes the contents of the string without ... Read More

Java program to print number series without using any loop

AmitDiwan

AmitDiwan

Updated on 22-Aug-2024 11:58:39

1K+ Views

In this article, we will learn how to print a sequence of numbers in Java, ranging from 0 to 15. To do this, we'll use recursion rather than using loops like for loop or while loop. Recursion is a programming technique where a method calls itself to perform a sub-operation as ... Read More

Grouping Selectors in CSS

AmitDiwan

AmitDiwan

Updated on 14-Aug-2024 12:19:51

20K+ Views

CSS grouping selector is used to select multiple elements and style them together. This reduces the code and extra effort to declare common styles for each element. To group selectors, each selector is separated by a space. In this article, we will be understanding how to apply grouping selectors in ... Read More

How to zoom/scale an element on hover with CSS?

AmitDiwan

AmitDiwan

Updated on 13-Aug-2024 12:56:25

3K+ Views

To zoom/scale an element on hover with CSS, we will be using two different approaches. In this article, we will be understanding these two approaches to explain how to zoom/scale an element on hover with CSS. We are having two examples in each approach where we have a div element ... Read More

Java program to check if a string contains any special character

AmitDiwan

AmitDiwan

Updated on 12-Aug-2024 23:14:29

5K+ Views

In Java, checking if a string contains special characters can be easily done using regular expressions. We will be using the Pattern and Matcher classes from the java.util.regex package, we can efficiently determine whether a string includes any special characters. In this article, we will demonstrate how to use these ... Read More

Java program for longest increasing subsequence

AmitDiwan

AmitDiwan

Updated on 12-Aug-2024 23:12:31

2K+ Views

In this program, we find the length of the longest increasing subsequence (LIS) in an integer array using Java programming language. An increasing subsequence is a sequence of numbers where each number is greater than the previous one. The program uses a dynamic programming approach to compute the longest ... Read More

Java program to swap pair of characters

AmitDiwan

AmitDiwan

Updated on 09-Aug-2024 23:59:56

2K+ Views

In this article, we’ll learn how to swap pairs of characters in a Java string. We start with a simple method that converts the string into a character array, allowing us to swap characters directly. Then, we’ll explore an object-oriented approach where the swapping logic is encapsulated in a separate ... Read More

Java program to print even length words

AmitDiwan

AmitDiwan

Updated on 09-Aug-2024 23:58:12

2K+ Views

In this article, we will understand how to print even-length words. The string is a datatype that contains one or more characters and is enclosed in double quotes (“ ”). Char is a datatype that contains an alphabets an integer or a special character. Problem Statement Write a Java program ... Read More

Advertisements