Hashing,Sets,Maps

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/72

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

73 Terms

1
New cards

The process of converting a given key into another value using a hash function.

Hashing

2
New cards

A data structure that maps keys to values using a hash function for fast operations.

Hash Table

3
New cards

The mathematical function used to generate a hash value from a key.

Hash Function

4
New cards

The formula used to determine the index or position where data is stored.

h(k) = k mod m or index = hash(key) % array_size

5
New cards

The array position where a key-value pair is stored.

Bucket

6
New cards

The part of hashing where the index determines which bucket will hold the key-value pair.

Storage in Buckets

7
New cards

The key-value structure used to store data in hash tables.

Key-Value Pair

8
New cards

The process of adding a new key-value pair into the hash table.

Insertion

9
New cards

The process of finding or getting the value associated with a key.

Retrieval

10
New cards

The process of deleting a key-value pair from the hash table.

Deletion

11
New cards

The operation that checks if a given key exists in the table.

Checking

12
New cards

The Java class used to implement a hash table-based map.

HashMap

13
New cards

The Java method used to insert a key-value pair in a HashMap.

put(key, value)

14
New cards

The Java method used to retrieve a value using its key.

get(key)

15
New cards

The Java method used to remove a key-value pair.

remove(key)

16
New cards

The Java method that checks if a specific key exists.

containsKey(key)

17
New cards

A real-life analogy used for hashing that compares it to a library with numbered shelves.

Library Analogy

18
New cards

The process of determining how the hash table is structured, sized, and organized.

Table Design

19
New cards

The act of two different keys producing the same hash value.

Collision

20
New cards

The measure of how full a hash table is, calculated as entries divided by buckets.

Load Factor

21
New cards

The process of creating a larger table and recomputing indices when the load factor is too high.

Rehashing

22
New cards

The number of available slots or array positions in a hash table.

Table Size

23
New cards

A recommended kind of number to use for table size to reduce clustering.

Prime Number

24
New cards

The property of a good hash function that ensures the same key always yields the same hash.

Determinism

25
New cards

The property of a good hash function that distributes keys evenly across buckets.

Uniform Distribution

26
New cards

The property of a good hash function that allows quick computation.

Efficiency

27
New cards

The data-holding unit or slot in a hash table that can contain one or more key-value pairs.

Bucket

28
New cards

The method of handling collisions by storing multiple elements in the same bucket using a linked list.

Chaining

29
New cards

The collision handling method where each bucket holds only one entry and another slot is searched if full.

Open Addressing

30
New cards

The open addressing method that checks the next slot sequentially.

Linear Probing

31
New cards

The open addressing method that checks slots using quadratic steps to reduce clustering.

Quadratic Probing

32
New cards

The open addressing method that uses a second hash function to determine the step size.

Double Hashing

33
New cards

The process of adjusting or increasing the table size when the load factor exceeds a certain threshold.

Resizing / Rehashing

34
New cards

The situation when two or more keys are assigned to the same index or bucket.

Collision

35
New cards

The technique that handles collisions by using linked lists or trees in each bucket.

Chaining

36
New cards

The data structure often used in chaining to link multiple key-value pairs.

Linked List

37
New cards

The data structure sometimes used instead of a linked list when a bucket list gets too long.

Balanced Tree

38
New cards

The technique that handles collisions by finding the next open bucket through probing.

Open Addressing

39
New cards

The condition that triggers the creation of a larger hash table and redistribution of keys.

High Load Factor

40
New cards

The process of copying existing elements into a new, larger hash table with recomputed hash values.

Rehashing

41
New cards

A data structure that stores a collection of unique elements without duplicates.

Set

42
New cards

The set implementation that uses a hash table and does not maintain order.

Unordered Set / HashSet

43
New cards

The set implementation that uses a balanced binary search tree to keep elements sorted.

Ordered Set / TreeSet

44
New cards

The property of sets that ensures each element appears only once.

Uniqueness

45
New cards

The time complexity of basic set operations such as insertion or search on average.

Constant Time

46
New cards

The Java class that represents an unordered set.

HashSet

47
New cards

The Java class that represents an ordered set.

TreeSet

48
New cards

The Java method used to add an element to a set.

add(element)

49
New cards

The kind of output shown when printing a HashSet, where order is not guaranteed.

Unordered Output

50
New cards

The kind of output shown when printing a TreeSet, where order is always ascending.

Sorted Output

51
New cards

The internal data structure used by a TreeSet.

Binary Search Tree (BST)

52
New cards

A data structure that stores information as key-value pairs.

Map

53
New cards

The rule that each key in a map must be unique.

Uniqueness of Keys

54
New cards

The operation that associates a specific key with a value in a map.

Insertion (put)

55
New cards

The operation that retrieves a value using its corresponding key.

Retrieval (get)

56
New cards

The operation that removes a key and its value from a map.

Deletion (remove)

57
New cards

The property of a map that allows dynamic resizing when elements are added or removed.

Dynamic Size

58
New cards

The type of map implemented using a hash table.

HashMap

59
New cards

The type of map implemented using a binary search tree.

TreeMap

60
New cards

The type of map implemented using hashing and a linked list to maintain insertion order.

LinkedHashMap

61
New cards

The Java method used to insert key-value pairs in a map.

put(key, value

62
New cards

The Java method used to retrieve values from a map.

get(key)

63
New cards

The Java method used to check if a key exists in a map.

containsKey(key)

64
New cards

The Java method used to delete key-value pairs from a map.

remove(key)

65
New cards

The default print format when displaying map contents.

{key=value, key2=value2}

66
New cards

The map that provides constant-time lookups but no ordering.

HashMap

67
New cards

The map that stores keys in sorted order.

TreeMap

68
New cards

The map that preserves insertion order when iterating.

LinkedHashMap

69
New cards

The reason prime numbers are used as table sizes in hashing.

To reduce clustering

70
New cards

The metric that measures how full the hash table is.

Load Factor

71
New cards

The data structure used in chaining to store multiple values in one bucket.

Linked List

72
New cards

The situation when the hash function gives the same index for two different keys.

Collision

73
New cards

The process of creating a new table and re-computing all hash values when resizing.

Rehashing