mirror of
https://github.com/TheAlgorithms/Ruby
synced 2025-01-27 19:58:06 +01:00
Delete Intuition
This commit is contained in:
parent
12c69e8429
commit
d73d64ed95
1 changed files with 0 additions and 15 deletions
|
@ -8,21 +8,6 @@
|
||||||
# Approach 1: Hash it!
|
# Approach 1: Hash it!
|
||||||
#
|
#
|
||||||
|
|
||||||
# Intuition
|
|
||||||
#
|
|
||||||
# This approach is an optimization over approach 2. When the
|
|
||||||
# number of mappings are limited, approach 2 looks good. But What
|
|
||||||
# if you decide to add too many mappings?
|
|
||||||
#
|
|
||||||
# Having a condition for every mapping is not feasible or may be
|
|
||||||
# we can say the code might get ugly and tough to maintain.
|
|
||||||
#
|
|
||||||
# What if tomorrow we have to change a mapping or maybe delete
|
|
||||||
# a mapping? Are we going to change the code every time we have a
|
|
||||||
# modification in the mappings?
|
|
||||||
#
|
|
||||||
# We don't have to. We can put all these mappings in a Hash Table.
|
|
||||||
|
|
||||||
# Complexity Analysis
|
# Complexity Analysis
|
||||||
|
|
||||||
# Time Complexity: O(N)
|
# Time Complexity: O(N)
|
||||||
|
|
Loading…
Add table
Reference in a new issue