Skip to content

Commit d538707

Browse files
committed
more notes
1 parent bc2a354 commit d538707

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# :chart_with_upwards_trend: Data Structure : Hashing Concepts
2+
3+
##### DAT ~ Direct Address Table
4+
5+
Type of data structure used to represent a universe of keys explicitly. Each key has its unique slot in the table, and the value associated with a key is stored in its specific slot. This eliminates the need for any hashing function.
6+
7+
While DATs provide constant-time operations and are straightforward, they are only suitable for specific use cases due to their space requirements. It's essential to evaluate the application's needs and the universe of keys before choosing this data structure.
8+
9+
##### DAT: Algorithmic Complexity
10+
11+
- **Insertion**: O(1)
12+
- **Deletion**: O(1)
13+
- **Search**: O(1)
14+
15+
Since DAT uses direct addressing, it can achieve constant time complexity for these basic operations.
16+
17+
##### DAT: Applications
18+
19+
- The universe of possible keys is relatively small, making it feasible to allocate memory for all potential keys.
20+
- Almost all keys from this universe are present, ensuring that the memory isn't wasted.
21+
- We need constant-time operations for insertion, deletion, and search.
22+
- There's no need for any advanced operations like predecessor, successor, etc.
23+
24+
##### DAT: Limitations
25+
26+
- DATs can be memory-intensive if the universe of keys is large but only a small subset is used.
27+
- Not suitable when the universe of keys is dynamic or very large, as it can lead to a lot of wasted space.

0 commit comments

Comments
 (0)