AmitDiwan has Published 11365 Articles

Java Program to Implement the queue data structure

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 08:01:28

2K+ Views

In this article, we will understand how to implement the queue data structure. A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).Below is a demonstration of the same −Suppose our input is −Input Queue: ... Read More

Java Program to Implement the graph data structure

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:45:08

821 Views

In this article, we will understand how to implement the graph data structure. we implement the graph data structure we implement graphs in Java using HashMap collection. HashMap elements are in the form of key-value pairs. We can represent the graph adjacency list in a HashMap.Below is a demonstration of ... Read More

Java Program to Sort ArrayList of Custom Objects by Property

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:40:55

584 Views

In this article, we will understand how to sort arrayList of custom objects by property. The ArrayList class extends AbstractList and implements the List interface. ArrayList supports dynamic arrays that can grow as needed.Array lists are created with an initial size. When this size is exceeded, the collection is automatically ... Read More

Java Program to Perform the inorder tree traversal

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:39:14

641 Views

In this article, we will understand how to perform the inorder tree traversal. In InOrder traversal, each node is processed between subtrees.In simpler words, visit left subtree, node and then right subtree.Below is a demonstration of the same −Suppose our input is −Run the programThe desired output would be −The ... Read More

Java Program to Sort a Map By Values

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:33:04

344 Views

In this article, we will understand how to sort a map by values. Java HashMap is a hash tablebased implementation of Java's Map interface. It is a collection of key-value pairs.Below is a demonstration of the same −Suppose our input is −Input HashMap: Key = Java, Value = 45 Key ... Read More

Java Program to Merge two lists

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:32:25

357 Views

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

Java Program to Initialize a List

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:24:34

636 Views

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

Java Program to Rotate Elements of a List

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:24:09

327 Views

In this article, we will understand how to rotate elements of a list. The List extends Collection and declares the behavior of a collection that stores a sequence of elements. The Collection is a framework that provides architecture to store and manipulate the group of objects. Java Collections can achieve ... Read More

Java Program To Find all the Subsets of a String

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:21:35

998 Views

In this article, we will understand how to find all the subsets of a string. String is a datatype that contains one or more characters and is enclosed in double quotes(“ ”). A part or a subset of string is called substring.Below is a demonstration of the same −Suppose our ... Read More

Java Program to divide a string in 'N' equal parts

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 07:07:44

507 Views

In this article, we will understand how to divide a string in 'N' equal parts. String is a datatype that contains one or more characters and is enclosed in double quotes(“ ”).Below is a demonstration of the same −Suppose our input is −Input string: Java Program is fun!The desired output ... Read More

Advertisements