Sets and Maps

16 Karteikartenvon Maria
Diese Karteikarten lernenKostenlos · Spaced Repetition · iPhone, Android, Mac & Web

Alle Karten

1
What is the advantage of storing data in binary format?
Records are the all the same size so they are easy to access randomly, and update.
2
What are the two basic ways to represent a set?
explicitly - uses a bit vector
implicitly - uses List, usually sorted List to improve Big O notation
3
What does it mean to "serialize" an object.
Professor answer: Copy an object to an output stream in a way that when deserialized it maintains its structure, i.e. a binary tree.
Better answer lol To serialize an object means to convert it into a flat, transferable format that captures its data and structure, allowing it to be saved or sent elsewhere and then reconstructed back into an object. This is essential for persistence, data sharing, and communication between systems.
4
The mathematical definition of a set is that is has no particular order. However when we use HashSet or TreeSet there is certain ordering given to the elements of the set because of the basic data structure that they are stored in. What is the difference between the "order" for a HashSet and a TreeSet.
A HashSet is ordered by the hashcode. A TreeSet is ordered by the natural ordering of the objects being placed in to the Set.
5
What is a map?
A mapping from the key set to the value set. It associates a key to a value.
6
What are the two ways data can be stored?
1) Key
2) Binary
7
Every [A] in a map has a unique value.
Key
8
Random access files use a [A] to determine the location in the file to read from or write to.
File pointer
9
A [A] in a map can be associated with several keys.
Value
10
ObjectInputStream and ObjectOutputStream can only read/write objects that support the [A] interface.
Serializable
11
What is the difference between a set and a map?
A set stores unique elements. A map stores associations between keys and values.
12
What are the basic operations that are unique to a Set?
[A] union
[B] intersection
[C] difference
13
How would 12,345 be represented in:
text format [A]
binary format[B]
Text Format: stored as characters
'1' '2' '3' '4' '5'
Binary Format: stored as 4 bytes
0 0 48 57
14
Classes that implement Serializable but require special handling during the serialization and deserialization process must give definitions for which methods:
[A] readObject
[B] writeObject
15
What are the two most common Java library classes that implement the Set interface?
[A] HashSet
[B] TreeSet
16
What does it mean to "serialize" an object?
Copy an object to an output stream in a way that when deserialized it maintains its structure, i.e. a binary tree.
Alle 16 Karten kostenlos lernen

Mehr Karteikarten: Geschichte und Geisteswissenschaften

Shakespearean idioms13 KartenGeschichte und Geisteswissenschaften · Englischanya€Egypt Tiimeline10 KartenGeschichte und Geisteswissenschaften · Englischmrwright07KP ILR 1+ Refined Words List188 KartenGeschichte und Geisteswissenschaften · KoreanischHwanThe Tempest Adaptations and Critics102 KartenGeschichte und Geisteswissenschaften · EnglischemiLinguistics and Representation Terms70 KartenGeschichte und Geisteswissenschaften · EnglischAnaïsUSD Rock MUS 100: Elements I & II55 KartenGeschichte und Geisteswissenschaften · EnglischAlaynascholars ++43 KartenGeschichte und Geisteswissenschaften · Englischanya€Mapeh 4qr35 KartenGeschichte und Geisteswissenschaften · EnglischHernandezArt29 KartenGeschichte und Geisteswissenschaften · Englischemma.beelFab Vocab 26-5025 KartenGeschichte und Geisteswissenschaften · EnglischWinnARTH 120 KartenGeschichte und Geisteswissenschaften · EnglischMikeyMidterm - Art Shows16 KartenGeschichte und Geisteswissenschaften · EnglischMorgs

Alle Decks: Geschichte und Geisteswissenschaften

Lerne diese Decks in der App

Kostenlos auf iPhone, Android, Mac und im Web. Füge jedes Deck mit einem Tipp zu deinem Konto hinzu.

Laden im App StoreJetzt bei Google Play
Alle 16 Karten kostenlos lernen