Skip to content

Tag Archives: Java-Collections

LinkedHashSet is an implementation of Set Abstract Data Type (ADT). It extends from the HashSet class which in-turn implements Set Interface. The difference between the… Read More
The Vector class in java implements a dynamic array i.e. it can grow and shrink according to the elements that we insert or remove to/from… Read More
The LinkedHashMap is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap provided the advantage of quick… Read More
ArrayList is part of the collection framework. It is a List and implements the java.util.list interface. ArrayList is a better alternative to Arrays, especially if… Read More
The List interface allows storing the ordered collection. It is a child interface of Collection. It is an ordered collection of objects in which duplicate… Read More
Unordered Collections in java does not provide any order i.e. the elements cannot be accessed using specific indexing or ordering as we could in the… Read More
For traversing a linked list in reverse order we can use Descending Iterator or List Iterator 1.  Descending Iterator Syntax: LinkedList<String> linkedlist = new LinkedList<>();… Read More
TreeSet is mainly an implementation of SortedSet in java where duplication is not allowed and objects are stored in sorted and ascending order. TreeMap is… Read More
ArrayList class in Java is basically a resizeable array i.e. it can grow and shrink in size dynamically according to the values that we add… Read More
To get TreeSet Element Greater than Specified Element using ceiling() Method in Java. The ceiling method in Java return the least element in the set… Read More
TreeMap class is like HashMap. TreeMap stores key-value pairs. The main difference is that TreeMap sorts the key in ascending order. TreeMap is sorted as… Read More
A LinkedList is a linear data structure, in which the elements are not stored at contiguous memory locations. For converting a linked list to a… Read More
The Java.util.LinkedList.removeFirst() method is used to remove the first element from the LinkedList.  The Java.util.LinkedList.removeLast() method is used to remove the last element from the… Read More
A PriorityQueue is a linear data structure in which the elements are ordered according to their natural ordering or by some custom comparator provided at… Read More
TreeMap is a part of the Java Collections framework. Java TreeMap contains values based on the key. It implements the NavigableMap interface and extends AbstractMap… Read More