What is the space complexity of this dictionary in Python?
(1) My Guess: O(V+E) where V is the number of key and E is the maximum length of array value in dictionary.
{
'key' : ['value', 'value2', ...],
'key2': ['value30', 'value31', ...],
...
}
Small Question: If the dictionary is formed of directed graph, should its space complexity be O(2E)?
(2) My Guess: O(V) where V is the number of key.
{
'key' : 4,
'key2': 5,
...
}