1.4 - Data types, Data Structures and Algorithms (Unfinished) Flashcards
1
Q
Worded Effect of Bitwise Mask: AND
A
- EXTRACTS a subset of the bits in the value; when the mask is 1, you are copying the original binary sequence and when the mask is 0, you are blanking it.
2
Q
Worded Effect of Bitwise Mask: OR
A
- Can SET a subset of the bits in the value; when the mask is 1, sets value to 1 and when the mask is 0, you are leaving it alone.
3
Q
Worded Effect of Bitwise Mask: XOR
A
- TOGGLES a subset of the bits in the value: when the mask is 1, the value is changed (“toggled”) and when the mask is 0, the value stays the same
4
Q
Output of values in instances of Bitwise Mask: AND
A
- If both values are 1: Output = 1
- If not: Output = 0
5
Q
Output of values in instances of Bitwise Mask: OR
A
- If either the value or the mask is 1: Output = 1
- If both are 0: Output = 0
6
Q
Output of values in instances of Bitwise Mask: XOR
A
- If the value and the mask are different (one is 0 and the other is 1): Output is 1
- If the value and the mask are the same (both 0 or both 1): Output is 0
7
Q
What is a Character Set?
A
- The characters or symbols that can be recognised, represented, interpreted, understood and used by a computer.
- Each required character is represented by a unique binary code or number so each symbol is distinguishable from
all others.
8
Q
Similarities between ASCII and Unicode
A
- Both use binary to represent characters / are character sets
- The first 7/8 bits of Unicode is the same as ASCII (overlaps)
9
Q
Differences between ASCII and Unicode
A
- ASCII has fewer characters (128/256); Unicode has more characters
- ASCII is 7/8 bits whereas Unicode can be larger (16/32 bits) and can have variable sized characters
- ASCII limited to Latin / English / European characters whereas Unicode can represent other symbols (e.g. Chinese/Emojis)
10
Q
What does ASCII stand for?
A
American Standard Code for Information Interchange
11
Q
Describe an Array
A
A static data structure that holds multiple pieces of data (of the same data type) contiguously in memory with a single identifier
12
Q
Dimensions of Arrays
A
- 1D Array - A single set of data, which can be visualised in a single row
- 2D Array - A set of data that can visualised in rows and columns; items are called by [Row Num. , Column Num.]
- 3D Array - A collection of 2D Arrays that can be visualised one behind the other; items are called by [2D Array Num. , Row Num. , Column Num.]
13
Q
Describe a Record
A
- Can store multiple values under one identifier
- The data can be of different data types
14
Q
Describe a List
A
- A mutable collection of items that can store more than one data type
- Size is not fixed and items can be changed or replaced
- [] in Python
15
Q
Describe a Tuple
A
- An immutable collection of items that can store more than one data type
- Size is fixed and items cannot be changed or replaced
- () in Python