Write specifications for a list whose operations insert, remove, getEntry, and replacealways act at the end of the list.
What will be an ideal response?
Specify isEmpty and getLength as you would for the ADT list given in this chapter.
+insert(newEntry: ItemType): boolean
Task: Inserts an entry at the end of this list.
Input: newEntry is the new entry.
Output: True if the insertion is successful; otherwise false.
+remove(): boolean
Task: Removes the entry at the end of a list.
Output: True if the removal is successful; otherwise false.
+getEntry(): ItemType
Task: Retrieves the entryat the end of a list.
Output: The desired entry.
+replace(newEntry: ItemType): void
Task: Replacesthe entry at the end of a list with the given entry.
Input: newEntry is the replacement entry.
Output: None.
?
You might also like to view...
Which of the following is not one of the three general types of computer languages?
a. Machine languages. b. Assembly languages. c. High-Level languages. d. Spoken languages.
In the context of web page interactivity, a(n) _________ can be described as an action taken by the user.
a. object b. event c. tag d. browser
In a single loop ring topology network, each data packet is passed from node to node in both directions, and the destination station copies the data into a local buffer.
Answer the following statement true (T) or false (F)
When a hashing algorithm is applied, the hash will ALWAYS have a fixed length.
True False