Skip to content
Ravnary
A Knowledge Platform
Categories
Learn
Cheatsheets
Paths
Favourites
Review
Community
Colour theme
Light
Dark
System
Learn
Data Structures
Measuring Cost
Analysing Complexity
Quiz
Q 01
/ 05
Intermediate
Question 1 of 5. 0 correct, 0 incorrect.
Inside a loop over n items in Python, which of these make the loop O(n²) in the worst case rather than O(n)?
Hint
Ask how much of the list each call touches.
x in some_set
x in some_list
rest = some_list[1:]
some_list.append(x)
some_list[-1]
some_list.pop(0)
Check answer
Home
Learn
Paths
Saved
Community