Skip to main content

Back to the full dot-point answer

SingaporeComputer ScienceQuick questions

Data Structures

Quick questions on Arrays and records explained: H2 Computing

4short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.

What are two-dimensional arrays?
Show answer
A 2D array (a grid or matrix) is indexed by row and column, grid[r][c], and is typically stored row by row in memory (row-major order). The address arithmetic extends naturally, so element access is still O(1)O(1).
What are records?
Show answer
A record (or struct) groups several fields, which may be of different types, under one name:
What is q2?
Show answer
Why is inserting an element at the front of an array O(n)O(n)? [1 mark]
What is q3?
Show answer
Give one advantage of an array of records over several parallel arrays. [1 mark]

Have a question we have not covered?

This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.

All Computer ScienceQ&A pages