Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.47 KB

NOTES.md

File metadata and controls

28 lines (22 loc) · 1.47 KB

Notes

Data types and Data Structures

A variable's data type determines the values that the variable can store and the operations that can be performed on it. For example, an integer is a whole number, which can be added, subtracted, multiplied, or divided.

  • An integer is an example of a primitive data type, as it can contain only one value. Other examples of primitive data types are real (fractional numbers), Boolean (true or false values), and character. Although a string is a collection of characters, it is usually classified as a primitive data type.

  • A composite or compound data type is built by combining primitive data types. Example: record, class

  • A data structure is a collection of data that is organised to allow efficient processing. For example, the contents of an array can be sorted using a wide range of sorting algorithms. Different data structures lend themselves to different applications. Some data structures are highly specialised to specific tasks. For example, an abstract syntax tree is a data structure widely used in compilers to represent the structure of program code.

  • An abstract data type is a conceptual model that describes how data is organised and which operations can be carried out on the data (e.g. insert, delete) from the perspective of an end user who does not need to know how this is implemented. There are often many ways to implement an abstract data type, depending on the programming language being used.