Question
QUESTION 11 What is the complexity of a selection sort? a. O(n) b. O2 c. O(n2) d. O(log2n) QUESTION 12 What type of algorithm is
QUESTION 11
What is the complexity of a selection sort?
a. O(n)
b. O2
c. O(n2)
d. O(log2n)
QUESTION 12
What type of algorithm is the following code?
i = 0
while i < len(myList) - 1:
minIndex = i
j = i + 1
while j < len(myList):
if myList[j] < myList[minIndex]:
minIndex = j
j += 1
if minIndex != i:
swap(myList, minIndex, i)
i += 1
- sequential search
- binary search
- selection sort
- bubble sort
QUESTION 13
On average, what is the performance of a sequential search on a singly linked structure?
a. random
b. logarithmic
c. linear
d. exponential
QUESTION 14
What is the operation on a linked structure called that visits each node without deleting it?
a. insertion
b. traversal
c. probe
d. removal
QUESTION 15
What is the name of the method that performs the constructor operation for a class?
a. __add__
b. __eq__
c. __init__
d. __iter__
QUESTION 16
What word is best defined as the use of common names for operations on different types of collections?
a. anachronism
b. polymorphism
c. modularization
d. concatenation
QUESTION 17
Which of the following is a visual aid to help catalog resources in your software toolbox?
a. class diagram
b. method mapper
c. unit modeler
d. docstring
QUESTION 18
What is one of the primary purposes of using inheritance?
a. to customize an existing class
b. to create code redundancy
c. to duplicate methods in an interface
d. to avoid creating an __init__ method
QUESTION 19
Which of the following is true about abstract classes?
a. they are the same as a class interface
b. they are not normally instantiated in client applications
c. they are used as concrete classes by client applications
d. the are always a subclass of a superclass
QUESTION 20
What type of operation is the following code performing?
probe = head
while probe != None and targetItem != probe.data:
probe = probe.next
if probe != None:
probe.data = newItem
return True
else:
return False
a. sum of all items
b. deletion
c. insertion
d. replacement
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