Question
In python/algorithms, what is the time complexity of pop(i) for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.pop(0)?
Answer
O(n)
^^ this is python sacrifice to make index assignment O(1)
Question
In python/algorithms, what is the time complexity of pop(i) for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.pop(0)?
Question
In python/algorithms, what is the time complexity of pop(i) for lists (e.g. you have l = [1,2,3,4,5], what is big-O of doing: l.pop(0)?
Answer
O(n)
^^ this is python sacrifice to make index assignment O(1)
If you want to change selection, open document below and click on "Move attachment"
pdf
owner:
kkhosravi - (no access) - ProblemSolvingwithAlgorithmsandDataStructures.pdf, p59
Summary
status | not learned | | measured difficulty | 37% [default] | | last interval [days] | |
---|
repetition number in this series | 0 | | memorised on | | | scheduled repetition | |
---|
scheduled repetition interval | | | last repetition or drill | | | | |
---|
Details
No repetitions