Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

' A ' and ' B ' are two python lists. A = [ 1 , 2 , 3 , 4 ] B = [

'A' and 'B' are two python lists.
A=[1,2,3,4]
B=[10,20,30]
What will be the value of 'A' after the following operation is done?
A.extend(B)
a)1,2,3,4,10,20,30
b)11,22,33,4
c)1,2,3,4
d)10,20,30
12.'A' is a python tuple of length 10. Which one of the following is an invalid tuple operation?
b) A.count(11)
a) len(A)
c) A.append(3)
d)A[3:6]
13. What will be the value of 'B' after the following lines are executed in python?
A=[1,2,3,4,5]
B=A
A[2]=A[2]+1
#Hint: run the code to see the value of 'B'
a)1,2,4,4,5
b)1,2,3,4,5
c)1,2,3,1,4,5
d)1,2,1,3,4,5
14. What will be the value of 'B' after the following lines are executed in python?
A=[1,2,3,4,5]
B=list(A)
A[2]=A[2]+1
a)1,2,4,4,5
b)1,2,3,4,5
c)1,2,3,1,4,5
d)1,2,1,3,4,5
15.'A','B' and 'C' are python tuples of length p,q and r. What will be the running time of the following operation?
A+B+C
a)O(p**q**r)
b)O(p+q+r)
c)O(log(p**q**r))
d)
16. Binary search runs in time in a sorted and indexed sequence.
a)O(n)
b) U(Iogn)
c)O(n2)
d)O(n0.5)
17. Which one of the following is tunning time of insertion sort in the worst-case scenario?
a)O(n)
b)O(logn)
c)O(n2)
d)O(n3)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions