10 Data types and structures - Cambridge AS & A Level Class 11 Computer Science Notes, Diagrams and Solved Questions

Choosing data types, defining and using records, 1D and 2D arrays with linear search and bubble sort, reading and writing text files, and the abstract data types stack, queue and linked list, including how each is stored in arrays.

In this chapter

  • Selecting INTEGER, REAL, CHAR, STRING, BOOLEAN, DATE, ARRAY and FILE for a problem
  • Defining a record with TYPE … ENDTYPE and reading and saving its fields
  • Array terms (index, lower and upper bound) and processing 1D and 2D arrays
  • Linear search and bubble sort in pseudocode, Python and Java
  • Why files are needed and handling text files with READ, WRITE and APPEND
  • ADTs: the features of stacks and queues and how to use them
  • Linked lists with start pointer, null pointer and free list
  • Implementing stacks, queues and linked lists using arrays