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.
- Connectionless service (packet switching)
where packets are dispatched with no knowledge of whether the receiver is ready to accept the packet and has no way of finding out whether a transmission has succeeded.
- Connection-oriented service (packet switching)
where the first packet is sent, including a request for an acknowledgement. If the acknowledgment is received, the sender transmits the rest of the packets; otherwise, the sender tries sending the first packet again.
The routing table
is a data table stored in a router that lists the routes to a particular network destination and the metrics associated with those routes. This information is necessary to forward a packet along the best path toward its destination.
Protocol
a set of rules, of which are agreed by both sender and recipient
Protocol suites
contain more than one individual protocol. This complexity of networking requires the use of more than one protocol.
- HTTP
hypertext transfer protocol: responsible for correct transfer of files that make up web pages on the WWW
- SMTP
simple mail transfer protocol: handles the sending of emails
- POP3/4
post office protocol: handles the receiving of emails
- DNS
Domain name service: protocol used to find the IP address
- FTP
file transfer protocol: used when transferring messages and attachments
TCP
stands for transmission control protocol. It receives the data from the application layer and splits them into equally sized packets. It also adds a header onto each packet, where if the packet is one of a sequence, a sequence number is included to ensure eventual correct reassembly of user data. Error checking information, for the receiver to use, is also added to the header. The packet is then transmitted to the network/internet layer.
Handshake
is a term used to describe the process of one computer establishing a connection with another computer or device. These steps included verifying the connection and authorization of a computer connection.
Ethernet
is a system that connects several computers together to form a LAN. It is a local protocol and doesn’t provide means to communicate with external devices. The Ethernet system uses protocols to control the movement of frames between devices and to avoid simultaneous transmission by two or more devices.
Wireless (WiFi) protocols
are wireless LANs that use a protocol called CSMA/CA (carrier sense multiple access with collision avoidance). This is not to be confused with CSMA/CD (carrier sense multiple access with collision detection). CSMA/CA is used to avoid collisions whilst CSMA/CD is used to resolve/handle collisions.