Computer Science Theory Flashcards
Pre-defined data types
are data types which have already been defined by language in which you are coding. E.g. Bool and integer. Meaning there is a pre-defined range of possible values
User-defined data types
are data types whose nature is defined by the user (the programmer). Meaning that there is a specific range unique to that program
Composite data types
are user defined data types that are built on other datatypes, defined data types (such as strings and integers). Examples include sets, classes, arrays, etc. Think of the word composite (joint, more than one, i.e., composite function)
Non-composite data types
are user-defined data types that do not reference any other data types
Sets
are given lists of unordered elements that can use set theory operations such as intersection and union. These are defined in a similar way to arrays, they just have normal parentheses and can hold both strings and numbers.
Classes
are composite data types that include variables of given data types and methods (methods are code routines that can be run by an object in that class).
Enumerated data type
Enumerated data type: a user defined, non-composite, data type that is ordinal, meaning that they have an implied order of values. i.e., months, in the year
Pointer data type
references memory location and needs to have information about the type of data that will be stored in the memory. These do not reference any data type though.
Text file
contains data stored according to a defined character code defined by ASCII or Unicode. This file can be created using a text editor
Binary file
is a file designed for storing data to be used by a computer program (1s and 0s). It stored data in its internal representation. It organizes the file based on records (a collection of fields containing data values). File – records- fields- values
Serial file organization
is a method used to organize record within a file. It does so by storing them in chronological order, meaning that files are stored in the order that they were added, with new records being appended to the end of the file.
Sequential file organization
stores records in an order that is usually based on the record’s unique key field, as the key field is essentially the record’s unique identifier. E.g. for a file containing data on the passwords of users.
Direct/Random-access method
Randomly ordered, where the record locations are determined by the product of a computation carried by the hashing algorithm.
Normalization
is the reduction in wasted bits by representing a number with the highest magnitude (there are no wasted leading zero bits). A normalized representation would mean that the two most significant bits are different. This reduction in wasted bits would mean greater precision and the elimination of ambiguity, especially regarding the sign of the number.
Rounding errors
difference between the result produced by an algo and the exact mathematical value. This can be attributed to the limited accuracy previously mentioned. This error becomes quite significant if calculations are repeated enough times. The only way to preventing this, is to increase the bits for the mantissa.
Overflow
occurs when the largest number that a register can hold is exceeded. This can often occur when an already large number in the mantissa is multiplied by another large number.
Underflow
occurs when the smallest number a register can represent is surpassed. This can often happen when an already small number is divided by a large number.
- Low-Level programming paradigm:
is programming instructions that use computer’s basic instruction set, such as assembly language.
- Imperative programming paradigm
involves writing a program as a sequence of explicit steps that are executed by the processor.
- Object-Oriented programming paradigm
object-oriented paradigm is based on objects interacting with one another. These objects are data structures with associated methods
- Declarative programming paradigm
where a program describes what the desired result should be
Record
a collection of fields containing data values. These values can be predefined, and, therefore, a record is a composite data type.
Circuit switching
is a method of transmission in which data travels along a dedicated communication path (circuit/channel). This channel lasts throughout the duration of the communication, where unimpeded (unobstructed) transmission takes place.
Packet switching
is a method of transmission where no circuit is established. Rather, the data is broken down into equal sized packets, consisting of a header (which includes instructions for delivery) and the data body itself, of which is sent down independent routes. The routes chosen for each packet will be the most optimum one. This will largely depend on the traffic on each route.