Problem

Consider an instance arrayList of AList, as given in the previous chapter. Let the list ha...

Consider an instance arrayList of AList, as given in the previous chapter. Let the list have an initial size of 10. Also, consider an instance of LList called chainList.

a. How large is the underlying array after adding 145 items to arrayList?

b. How large is the underlying array after adding 20 more items to arrayList?

c. How many nodes are in the chain after adding 145 items to chainList?

d. How many nodes are in the chain after adding 20 more items to chainList?

e. Each node in a chain has two references, so a chain of n nodes has 2n references. An array of size n, on the other hand, has n references. Count the number of references in each of the situations described in Parts a through d.

f. When will arrayList use fewer references than chainList?

g. When will chainList use fewer references than arrayList?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 14
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT