Arrays: Single and Double Dimensional - ISC Class 12 Computer Science Notes, Diagrams and Solved Questions

A short recap of 1-D arrays, searching and sorting, then address calculation for 1-D arrays and for 2-D arrays in row-major and column-major order, 2-D array programs (sums, diagonals, boundary, symmetry, transpose), sorting a matrix, and solving linear equations with Cramer's rule.

In this chapter

  • Recap of linear and binary search and bubble, selection and insertion sort
  • Address of an element in a 1-D array with any lower bound
  • Declaring and traversing 2-D arrays in Java: rows, columns, row and column sums
  • Row-major address calculation: B + W[N(i − Lr) + (j − Lc)]
  • Column-major address calculation: B + W[(i − Lr) + M(j − Lc)]
  • Matrix programs: diagonals, boundary elements, symmetry and transpose
  • Sorting all elements of a matrix through a 1-D array
  • Solving three linear equations by Cramer's rule with 2-D arrays