
Advanced Java Collections Concepts
Explore advanced programming concepts in Java Collections, including Collection, Iterator, Algorithms, List interfaces, Set interfaces, Queue interfaces, Deque interfaces, Stack implementation, and Map interfaces. Learn about various implementations such as ArrayList, LinkedList, HashSet, TreeSet, LinkedHashSet, ArrayDeque, PriorityQueue, HashMap, TreeMap, and LinkedHashMap.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Java Collections CS 240 Advanced Programming Concepts
Java Collections Collection, Iterator, Algorithms (Collections Class) 2
List List interface A sequence of elements accessed by index get(index), set(index, value) ArrayList (resizable array implementation) LinkedList (doubly-linked list implementation) 3
Set Set interface A collection that contains no duplicates add(value), contains(value), remove(value) HashSet (hash table implementation) TreeSet (bst implementation) LinkedHashSet (hash table + linked list impl) 4
Queue Queue interface A collection designed for holding elements prior to processing add(value), peek(), remove() ArrayDeque (fifo, resizable array impl) LinkedList (fifo, linked list implementation) PriorityQueue (priority queue, binary heap impl) 5
Deque Deque interface A queue that supports efficient insertion and removal at both ends addFirst(value), addLast(value), peekFirst(), peekLast(), removeFirst(), removeLast() ArrayDeque (resizable array implementation) LinkedList (linked list implementation) 6
Stack Java s Stack class is deprecated If you need a stack, use a Deque push() => Deque.addFirst() pop() => Deque.removeFirst() peek() => Deque.peekFirst() 7
Map Map interface A collection that maps keys to values A set of (key, value) pairs where keys are unique put(key, value), get(key), contains(key), remove(key) keySet(), values(), entrySet() HashMap (hash table implementation) TreeMap (bst implementation) LinkedHashMap (hash table + linked list impl) 8