Junior
What is the time complexity of the operation to search for all elements by index?
sobes.tech AI
Answer from AI
O(1) on average for lists due to direct index access. In the case of dictionaries (dict), key lookup is also O(1) on average.
sobes.tech AI
Answer from AI
O(1) on average for lists due to direct index access. In the case of dictionaries (dict), key lookup is also O(1) on average.