Calculate the number of elements that will be allocated


As indicated in the chapter, when a list is created using the replication operator values = [ None ] * 10000 the size of the underlying array used to implement the list can be up to twice the size actually needed. This extra space is beneficial to the list itself, but it can be quite wasteful when a list is used to implement some abstract data types. Consider the implementation of the Array2D abstract data type as described in the chapter. If we had used a list of lists to implement the ADT, instead of the array of arrays, a large amount of extra storage space would be allocated that would never be used. Calculate the number of elements that will be allocated when using an array of arrays implementation and a list of lists implementation of the Array2D abstract data type for each of the following 2-D array sizes:

1522_image.png

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Calculate the number of elements that will be allocated
Reference No:- TGS01715662

Expected delivery within 24 Hours