1.4 - Data types, Data Structures and Algorithms (Unfinished) Flashcards

You may prefer our related Brainscape-certified 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Output of values in instances of Bitwise Mask: AND

A
  • If both values are 1: Output = 1
  • If not: Output = 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does ASCII stand for?

A

American Standard Code for Information Interchange

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe a Record

A
  • Can store multiple values under one identifier
  • The data can be of different data types
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Static vs.Dynamic

A
  • Static - A data structure whose size cannot be changed at runtime
  • Dynamic - A data structure whose size can be changed at runtime
17
Q

Mutable vs. Immutable

A
  • Mutable - Its structure and the data it contains can be changed at runtime
  • Immutable - Its structure and the data it contains cannot be changed at runtime
18
Q

Describe a Linked List

A

A dynamic data structure where each node consists of data and a pointer that gives location of next node

19
Q

Describe a Graph

A
  • A collection of data nodes with connections () set between them
  • Graphs (edges) can be directed (directional or bi-directional) or can undirected
  • Graphs can also be weighted to show relationships between nodes such as distance
20
Q

Describe a Stack

A
  • A dynamic Last In First Out (LIFO) data structure; data is added to (Pushed) and removed (Popped) from the top of the stack
  • There are 2 pointers: a top (often called ‘Stack Pointer’) and a bottom
21
Q

Describe a Queue

A
  • A linear and dynamic First in First Out (FIFO) data structure; data is removed (dequeued) from the front of the queue and added (enqueued) to the back of the queue
  • There are 2 pointers: a top and a bottom
22
Q

Describe a Tree

A
  • A non linear and dynamic branching data structure that consists of a Root Node and sub nodes that are connected by edges
  • Trees are 1 directional and unweighted
23
Q

Describe a Binary Search Tree

A
  • A specific kind of tree where each node can only have a maximum of 2 children nodes