Consider the following strategy for array expansion/contraction: Whenever an element is added, increase the size of the array by one, and whenever an element is removed, decrease the size of the array by one. This strategy is not reasonable because:

A. elements sometimes take up more than one slot in the array.
B. there is a lot of element-copying taking place.
C. dynamic arrays cannot be adjusted by one
D. we are not working with a multi-dimensional array

B

Computer Science & Information Technology

You might also like to view...

Updating a master file is called

a) file maintenance b) file sorting c) file allocation d) all of the above

Computer Science & Information Technology

For String c = "hello world"; The Java statements int i = c.indexOf('o'); int j = c.lastIndexOf('l'); will result in:

a. i = 4 and j = 8. b. i = 5 and j = 8. c. i = 4 and j = 9. d. i = 5 and j = 9.

Computer Science & Information Technology