Suppose we desire to implement a method reverse for the Vector class. One approach would be to remove location 0 and to use add near the end or tail of the Vector. Defend or reject this suggested implementation. In either case, write the best method you can.
Suppose that a precisely sized array is used to hold data, and that each time the array size is to be increased, it is increased by exactly one and the data are copied over. Prove that, in the process of growing an array incrementally from size 0 to size n, approximately n2values must be copied.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here