In the following code that defines the push method for the array-based stack, what is the missing code?
def push (self, item): self.size += 1
A. self.items += 1
B. self.items[len(self)] = item
C. items[size] = len(self.item)
D. item = self.items[self.size + 1]
Answer: B
You might also like to view...
A database is a collection of ____.
A. data B. fields C. numbers D. objects
Identify the letter of the choice that best matches the phrase or definition.
A. An example could be a continuous stream of stock quotes. B. Familiar interface for PC users. C. Eclipse is an example. D. Windows are often organized into many of these. E. To run this, you must install a JVM on the computer.
Any class can contain an unlimited number of methods.
Answer the following statement true (T) or false (F)
Given the following master file containing employee names (key field) and hourly rates, which of the following transactions would cause an error message to occur?
Master File John 20.00 Mary 10.00 Sue 6.00 Tom 8.00 Vince 13.00 a) Add Mary 20.00 b) Delete Mary c) Delete Sue d) Change Tom 8.00