DSA - hash tables Flashcards
1
Q
what are hash tables
A
similar to stack and queue, hash tables represents dynamic set of data
2
Q
which operations does hash table supports
A
- hash tables supports insert / delete / search operation
3
Q
what is search average and worst search time for hash tables
A
average = O(1)
worst = O(n)
4
Q
what is another name for hash table
A
Dictionaries is another name for hash tables
5
Q
definition of dictionaries
what does dictionaries represents
A
generic way to map keys to values
6
Q
what is hash table in context of dictionaries
A
hash tables are specific ways to implement a dictionaries using a hashing function
7
Q
write dictionary example
A
dict = {
‘a’: 1,
‘b’: 9,
‘c’: ‘swapnil’,
‘d’: true
}
8
Q
write dictionary in python
A
dictionary[‘a’] = False
9
Q
what are direct access tables
A
10
Q
hashing by division
A
11
Q
A