0

I checked the deque section of the Python Time Complexity Wiki, but I couldn't find the average case and the amortized worst case time complexity of the non-empty deque constructor.

What would be the the average case and amortized worst case time complexity of the examples below?

Example 1

from collections import deque

answer = deque([[1, 4], [3, 9], [0, 2, 1], [3]])  

Example 2

from collections import deque

def myfunc(mylist):
    res = []
    for i in mylist:
        res.append(deque(mylist))
    return res

answer = myfunc([[1, 4], [3, 9], [0, 2, 1], [3]])
croatoan
  • 31
  • 4

0 Answers0