Unit 2-Part 3 Flashcards

(19 cards)

1
Q

What is a Map also known as?

A

Dictionary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does a Map do?

A

models a searchable collection of key value entries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the main operations of a map?

A

-Searching items
-Inserting items
-Deleting items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is not allowed in a map?

A

Multiple entries with the same key are not allowed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List applications of a map

A

-Address book
-Student record database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the map interface work?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the definition of load factor?

A

It is the measure that decides when to increase the capacity of the Map

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the default load factor?

A

75% of the capacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the HashMap and TreeMap?

A

two concrete class implementations of the Map interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the HashMap efficient for?

A

locating, inserting, and deleting a mapping value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the TreeMap efficient for?

A

for traversing the keys in a sorted order
-it maintains the map in ascending order of keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is LinkedHashMap?

A

extends HashMap with a linked list implementation that supports an ordering of the entries in the map

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the order of the entries in a LinkedHashMap

A

Can be retrieved in:
-insertion order
-access order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is insertion order?

A

In which the entries were inserted in a linked hash map

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is access order?

A

In which the entries were accessed from the most former one to the most recent one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Can TreeMap be used to sort by values?

A

No
-it defies the SortMap specification, which is sorted by key

17
Q

What does the Collections class contain?

A

contains various static methods for:
-operating on collection and maps
-creating synchronized collection classes
-creating read-only collection classes

18
Q

what does thread mean in Java?

A

is the path followed when executing a program

19
Q

What is a single threaded application?

A

has only 1 thread
-can handle only one task at a time