Skip to content

Category Archives: Java Programs

An Unrolled Linked List is a special type of Linked List in which each node stores an array of elements, unlike a simple linked list.… Read More
HashMap<K, V> is a part of Java’s collection since Java 1.2. This class is found in java.util package. It provides the basic implementation of the… Read More
The HashSet class implements the Set interface, backed by a hash table which is actually a HashMap instance. No guarantee is made as to the… Read More
In this article, we are going to see how to iterate through a List. In Java, a List is an interface of the Collection framework.… Read More
Given two integers N and K. Create an array of N positive integers such that the sum of all elements of the array is divisible… Read More
LinkedBlockingQueue API is an optionally-bounded queue based on linked nodes. It orders the elements in FIFO(First In First Out) order. The head of this queue… Read More
The WeakHashMap class is part of the Java Collections Framework, implementing the Map interface and extending the AbstractMap class. The Map interface helps us map… Read More
Problem Statement: This is a Java program for placements and interview criteria such as how many students will appear for online tests, academic results, and… Read More
A Rectangle is a quadrilateral with four right angles (90°). In a rectangle, the opposite sides are equal. A rectangle with all four sides equal… Read More
The pair class in C++ Standard Library is used a lot.  We can implement our own user-defined pair class in Java and its object can… Read More
A feedback vertex set of a graph is a set of vertices whose removal leaves a graph without cycles. The following graph becomes a Directed… Read More
In a graph with V vertices and E edges, the LIS (Largest Independent Set) is the set of all the vertices in the graph which… Read More
String Class stripLeading() method is used to strip leading whitespaces from the string i.e stripLeading() method removes all the whitespaces only at the starting of… Read More
The writeString() method of File Class in Java is used to write contents to the specified file. Syntax: Files.writeString(path, string, options) Parameters:  path – File… Read More
The readString() method of File Class in Java is used to read contents to the specified file. Syntax: Files.readString(filePath) Parameters:  path - File path with… Read More