Unit 2-Part 3 Flashcards
(19 cards)
What is a Map also known as?
Dictionary
What does a Map do?
models a searchable collection of key value entries
What are the main operations of a map?
-Searching items
-Inserting items
-Deleting items
What is not allowed in a map?
Multiple entries with the same key are not allowed
List applications of a map
-Address book
-Student record database
How does the map interface work?
the interface maps keys to the data elements
-the keys are like indices in a list, where the indices are integers
-In a map the keys can be any objects
What is the definition of load factor?
It is the measure that decides when to increase the capacity of the Map
What is the default load factor?
75% of the capacity
What is the HashMap and TreeMap?
two concrete class implementations of the Map interface
What is the HashMap efficient for?
locating, inserting, and deleting a mapping value
What is the TreeMap efficient for?
for traversing the keys in a sorted order
-it maintains the map in ascending order of keys
What is LinkedHashMap?
extends HashMap with a linked list implementation that supports an ordering of the entries in the map
What is the order of the entries in a LinkedHashMap
Can be retrieved in:
-insertion order
-access order
What is insertion order?
In which the entries were inserted in a linked hash map
What is access order?
In which the entries were accessed from the most former one to the most recent one
Can TreeMap be used to sort by values?
No
-it defies the SortMap specification, which is sorted by key
What does the Collections class contain?
contains various static methods for:
-operating on collection and maps
-creating synchronized collection classes
-creating read-only collection classes
what does thread mean in Java?
is the path followed when executing a program
What is a single threaded application?
has only 1 thread
-can handle only one task at a time