AmitDiwan has Published 11365 Articles

Java Program to Detect loop in a LinkedList

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 10:57:43

251 Views

In this article, we will understand how to detect loop in a LinkedList. A linked list is a sequence of data structures, which are connected together via links. Linked List is a sequence of links which contains items. Each link contains a connection to another link.Below is a demonstration of ... Read More

Java Program to Get key from HashMap using the value

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 10:40:31

4K+ Views

In this article, we will understand how to get key from HashMap using the value. Java HashMap is a hash table based 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: {Java=8, Scala=5, Python=15} Key: ... Read More

Java Program to Update value of HashMap using key

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 10:34:53

558 Views

In this article, we will understand how to update value of HashMap using key. Java HashMap is a hash table based 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: {Java=1, Scala=2, Python=3}The desired output ... Read More

Java Program to Remove duplicate elements from ArrayList

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 10:34:39

3K+ Views

In this article, we will understand how to remove duplicate elements from arrayList. The ArrayList class is a resizable array, which can be found in the java.util package. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified.Below is ... Read More

Java Program to Iterate over a Set

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 10:29:47

1K+ Views

In this article, we will understand how to iterate over a set. A Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction.The Set interface contains only methods inherited from Collection and adds the restriction that duplicate elements are prohibited.Below is a demonstration of the ... Read More

Java Program to Iterate over a HashMap

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 09:08:14

328 Views

In this article, we will understand how to iterate over a HashMap. Java HashMap is a hash table based 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: {Java=Enterprise, JavaScript=Frontend, Mysql=Backend, Python=ML/AI}The desired output would ... Read More

Java Program to Convert the ArrayList into a string and vice versa

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 08:46:31

284 Views

In this article, we will understand how to convert the arrayList into a string and vice versa. The ArrayList class is a resizable array, which can be found in the java. util package. The difference between a built-in array and an ArrayList in Java, is that the size of an ... Read More

Java Program to Convert the LinkedList into an Array and vice versa

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 08:20:05

267 Views

In this article, we will understand how to convert the linked list into an array and vice versa. The java.util.LinkedList class operations perform we can expect for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to ... Read More

Java Program to Get the middle element of LinkedList in a single iteration

AmitDiwan

AmitDiwan

Updated on 30-Mar-2022 08:13:49

144 Views

In this article, we will understand how to get the middle element of linkedList in a single iteration. The java.util.LinkedList class operations perform we can expect for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to ... Read More

Java Program to Print Boundary Elements of a Matrix

AmitDiwan

AmitDiwan

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

2K+ Views

In this article, we will understand how to print boundary elements of a matrix. A matrix is representation of the elements in rows and columns. Boundary elements are those elements which are not surrounded by elements on all four directions. For example, the elements in the first row, first column, ... Read More

Advertisements