[Solved] Which of the following arrays are used in the implementation of list data type in python?

Which of the following arrays are used in the implementation of list data type in python? a) Bit arrayb) Dynamic arraysc) Sparse arraysd) Parallel arrays Answer: bExplanation: Dynamic arrays are used in the implementation of list data types in python. Sparse arrays are used in the implementation of the sparse matrix in the Numpy module. …

Read more

[Solved] In special case, the time complexity of inserting/deleting elements at the end of dynamic array is __________

In special case, the time complexity of inserting/deleting elements at the end of dynamic array is __________ a) O (n)b) O (n1/2)c) O (log n)d) O (1) Answer: aExplanation: In general, the time complexity of inserting or deleting elements at the end of the dynamic array is O (1). Elements are added to the reserved …

Read more

[Solved] In which of the following cases dynamic arrays are not preferred?

In which of the following cases dynamic arrays are not preferred? a) If the size of the array is unknownb) If the size of the array changes after a few iterationsc) If the memory reallocation takes more time i.e. expensived) If the array holds less number of elements Answer: dExplanation: Dynamic arrays are preferred when …

Read more

[Solved] Both Dynamic array and Dynamically memory allocated array are same.

Both Dynamic array and Dynamically memory allocated array are same. a) Trueb) False Answer: bExplanation: Physical size of a Dynamic array is fixed with a larger value. Dynamically memory allocated arrays are arrays whose memory is allocated at run time rather than at compile time. Dynamically memory allocated arrays don’t have physical size at the …

Read more

[Solved] The size of the dynamic array is deallocated if the array size is less than _________% of the backend physical size.

The size of the dynamic array is deallocated if the array size is less than _________% of the backend physical size. a) 30b) 40c) 10d) 20 Answer: aExplanation: The size of the dynamic array is decreased/deallocated if the actual size of the array is less than 30% of the backend physical size. This is used …

Read more

[Solved] Dynamic arrays overcome the limit of static arrays

Dynamic arrays overcome the limit of static arrays. a) Trueb) False Answer: aExplanation: Static arrays have fixed capacity. The capacity must be specified during memory allocation. Dynamic arrays don’t require to specify their capacity during memory allocation. Dynamic arrays have fixed physical size at backend and its capacity increases if required. Thus, Dynamic arrays overcome …

Read more

[Solved] Which of the following is a disadvantage of dynamic arrays?

Which of the following is a disadvantage of dynamic arrays? a) Locality of referenceb) Data cache utilizationc) Random accessd) Memory leak Answer: dExplanation: Dynamic arrays share the advantage of arrays, added to it is the dynamic addition of elements to the array. Memory can be leaked if it is not handled properly during allocation and …

Read more