1.4.1 Data Types Flashcards
Primitive Data Types
“The basic data types provided by a programming language as building blocks. Most languages allow more complicated composite types to be recursively construction starting from basic types. E.g. char, integer, float, Boolean. As an extension a ‘string’ data type is constructed behind the scenes of many char data types.”
Integer
“A data type used to store positive and negative whole numbers
Real
“A data type used to store an approximation of a real number in a way that can support a trade-off between range and precision. A number is, in general, represented approximately to a fixed number of significant digits and scaled using an exponent.”
Floating Point
“A data type used to store an approximation of a real number in a way that can support a trade-off between range and precision. A number is, in general, represented approximately to a fixed number of significant digits and scaled using an exponent.”
Character
“A single alphanumeric character or symbol.”
String
“A sequence of alphanumeric characters and or symbols. e.g. a word or sentence.”
Boolean
“Used to store the logical conditions TRUE / FALSE. Often translated to On/Off, Yes/No etc.”
Binary
“Binary describes a numbering scheme in which there are only two possible values for each digit: 0 and 1. The term in computing refers to any digital encoding system in which there are exactly two possible states. E.g. in memory, storage, processing and communications, the 0 and 1 values are sometimes called “low” and “high”, respectively.”
Sign and Magnitude
“A method in computing of being able to store and represent floating point real numbers (both positive and negative) as a string of pure binary digits. Uses the concepts of two’s complements, mantissa and exponent.”
Two’s Complement
“A method in computing of being able to store negative numbers as string of pure binary digits. It works by turning the MSB into a sign bit, where 0 represents a positive number and 1 represents a negative.”
Hexadecimal
“A numerical system of notation which uses 16 rather than 10 as its base. The 16 Hex base digits are 0-9 and the letters A-F.”
Denary
“A numerical system of notation which uses 10 as its base. The 10 Decimal base digits are 0-9.”
Floating Point Arithmetic
“The mathematical process of performing simply calculations on more than one floating-point number stored in binary notation.”
Bitwise Manipulation
“The act of algorithmically manipulating bits or other pieces of data shorter than a word. Programming tasks that require a bit manipulation include low-level device control, error detection and correction algorithms, data compression, encryption algorithms, and optimisation.”
Shifts
“An operation that moves the bits held in a register, called the shift register, either to the left or the right. There are three different types of shift: arithmetic shift, logical shift and cyclic shift. They are distinguished by what happens to the bits that are shifted out of the register at one end and what is moved in to fill the vacant space at the other end.”
AND
“A logical operator used within a program. AND works by only returning TRUE if both values being compared are TRUE.”
OR
“A logical operator used within a program. OR works by returning TRUE as long as either value being compared is TRUE.”
XOR
“A logical operator used within a program. XOR stands for exclusive OR. It will return TRUE if the two items being compared are different.”
Character Sets
“The set of symbols that may be represented in a computer at a particular time. These symbols, called characters, can be letters, digits, spaces or punctuation marks, the set includes control characters.”
ASCII
America Standard Code for Information Interchange: “A character set devised for early telecommunication systems but proved to be ideal for computer systems. ASCII codes use 7-bits giving 32 control codes and 96 displayable characters (the 8th bit is often used for error checking).”
UNICODE
“Standard character set that replaces the need for all the different character sets. It incorporates characters from almost all the world’s languages. It is a 16-bit extension of ASCII.”
Adding data to a Linked List
- Store the data at the location indicated by the free storage pointer
- Alter the free storage pointer to the next free storage space
- Work out where in the list the new item should be inserted
- Set the pointer for the item that will precede it to the new data item
- Update the pointer for the new data item to that previously stored in the item that preceded it
Deleting data from a Linked List
IF item to remove is in first position THEN
Update starting pointer value to pointer value of item you want to delete
Update free pointers
EXIT PROCEDURE
ELSE
Update pointer value in the preceding node from the one you want to delete to the value of the pointer in item to be removed
Update free pointers
EXIT PROCEDURE
END IF
Traversing a Linked List
Set the pointer to the start value Repeat Go to node(pointer value) Output data at node Set the pointer to the value of the next item pointer at the pointer Until pointer = 0