Correctly To Score A+!!!!
1. How is the order of the entries of an ADT list determined?
a) by the list itself
b) by the client
c) by the operating system
d) the order doesn't matter CORRECT ANSWERS B.
2. Which element of the list does not have a unique predecessor?
a) the head of the list
b) the tail of the list
c) the middle element of the list
d) all have unique predecessors CORRECT ANSWERS A.
3. Changing the value of an entry at a given position on the list would probably be the
task of which of these
methods?
a) replace
b) get
c) push
d) insert CORRECT ANSWERS A.
# What type would the getLength method for a list return?
a) boolean
b) ItemType
c) integer
,d) void CORRECT ANSWERS C
4. Which of the following list methods would have only one parameter?
a) isEmpty
b) setEntry
c) insert
d) remove CORRECT ANSWERS D
5. Which of the following methods from list would have no parameters and void for the
return type?
a) setEntry
b) getEntry
c) insert
d) clear CORRECT ANSWERS D.
6. Given bList: snibble, nibble, tribble, wibble, quibble. The command
bList.insert(3, Bob) is executed. What is the appearance of the list?
a) snibble, nibble, tribble, Bob, wibble, quibble
b) snibble, nibble, Bob, tribble, wibble, quibble
c) snibble, nibble, tribble, wibble, quibble, Bob, Bob, Bob
d) Bob, Bob, Bob, snibble, nibble, tribble, wibble, quibble CORRECT ANSWERS B.
7. Given bList: bob, slob, snob, cob, hob, rob and the operation bList.remove(4) is
executed. What does the list become?
a) bob, slob, snob, hob, rob
b) bob, slob, snob, cob, rob
c) bob, slob
d) hob, rob CORRECT ANSWERS A.
, 8. Given cList: bip, snip, pip, rip, dip, clip. What value would be returned by the call to
method cList.getEntry(3)?
a) bip
b) snip
c) pip
d) rip CORRECT ANSWERS C.
9. Given cList: bip, snip, pip, rip, dip, clip. What value would be returned by the call to
method cList.insert(9, sip)?
a) true
b) false
c) it throws an exception
d) sip CORRECT ANSWERS B.
10. What should be returned by the list operation (aList.insert(2,x)).getEntry(2) ?
a) false
b) 2
c) x
d) an exception is thrown CORRECT ANSWERS C.
11. What would be returned by the list operation (bList.insert(3,x)).remove(3)?
a) 2
b) x
c) false
d) bList CORRECT ANSWERS D.