Programming Concept Assumptions

Programming Concept Assumptions

In order to write appropriate language-agnostic, psuedocode questions, we must make several assumptions about certain data structures. This page houses the assumptions that we have made.

2D Arrays

Here are some assumptions about 2D arrays that we are making:

  • Arrays are allocated with new. Therefore: int [][] grid <- new int[3][4]
  • Default values, like java.
  • No mixed data (we’re not exploring arrays of generic parent classes that can contain subclasses)
  • Arrays of arrays with fixed dimensioning, that is to say that a length function on the 2D array will return the number of rows and the length of the first row will be the number of columns
  • Test takers can assume that each row has the same number of columns
  • Although they are considered to be contiguous in memory and static, do not ask questions about row or column major ordering or use code like sizeof in C++
  • Constants are nested curly braces: { { 1, 2, 3 }, { 4, 5, 6 } }

Objects and Classes

A word about class definitions - since there is no specification for visibility of member variables to functions, in your questions where you present code for a class please write "... where x and y are accessible for reading and writing by all members of the class"