Which of the following describes a significant disadvantage of using a dynamic list instead of a static array when the total number of elements to be stored is fixed and known at compile time?
Oxford AQA International A-level · Computer Science (9645)
Arrays and lists:练习题
5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「Arrays and lists」。
A two-dimensional array \( \text{Grid}[5][10] \) is stored in row-major order in memory. The base address of the array is \( 1000 \) and each integer element occupies \( 4 \) bytes. Using 0-based indexing, what is the memory address of the element located at \( \text{Grid}[2][3] \)?
When comparing a static array to a dynamic list, which of the following is a characteristic specific to a static array?
Consider a dynamic list structure implemented using an underlying array. If the list is currently at its maximum capacity, what is the worst-case time complexity for a single append operation?
When comparing a two-dimensional static array to a list of lists (as implemented in Python), which statement accurately describes their physical storage in memory?
Explain one reason why a dynamic list might be less memory-efficient than a static array when storing the same number of data items.
先自己写一遍答案,再对照解题步骤。
Describe the sequence of actions that occurs at the memory level when an element is appended to a dynamic array that has reached its maximum current capacity.
先自己写一遍答案,再对照解题步骤。
In a two-dimensional array or a list of lists, describe how a specific element is located by the computer during an access operation.
先自己写一遍答案,再对照解题步骤。
A programmer is working with a one-dimensional static array named Scores containing 6 elements.
(a) Explain the difference between the index of an element and its data content.
(b) Describe the logic required to reverse the elements within the array Scores without using a second array. Identify the role of a temporary variable in this process.
先自己写一遍答案,再对照解题步骤。
A two-dimensional array \( \text{Data}[6][8] \) is stored in column-major order in memory, starting at the base address of \( 5000 \). Each element in the array is a real data type, which occupies \( 8 \) bytes of storage.
(a) Calculate the memory address of the element located at \( \text{Data}[3][5] \). Assume 0-based indexing is used and show your working.
(b) Explain why the calculation for column-major order differs from the calculation for row-major order.
先自己写一遍答案,再对照解题步骤。
* thinka提供的内容由AI生成,可能并非总是准确或最新。请将其用作辅助资源,并与官方材料进行核实。
想多做几道同类题目?立即开始练习这个课题,边做边批改。
立即练习