Question
Need help for Data Structure Hw: 1. Which of the list operations shown below is not O(1)? -list.pop(0) - list.pop() -list.append() -list(10) 2. Which of
Need help for Data Structure Hw:
1. Which of the list operations shown below is not O(1)?
-list.pop(0)
- list.pop()
-list.append()
-list(10)
2. Which of the dictionary operations shown below is O(n)?
- | 'x' in mydict |
- | del mydict['x'] |
- | mydict['x'] == 10 |
- | mydict['x'] = mydict['x'] + 1 |
- | mydict2 = mydict.copy() 3. Give the Big-O performance of the following code fragment: if 'alice' in x: # x is a list print('yes')
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started