1.4 Data Flashcards

Data Types Data Structures Boolean Algebra

You may prefer our related Brainscape-certified flashcards:
1
Q

What data type should be used for storing a phone number like 07574893758?

A
  • String
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Perform an AND mask on the binary numbers:
10101101
01011011

A

00001001

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What data type stores a collection of characters?

A

String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Add the two binary numbers:
01011011
00111010
Give your answer in decimal.

A

149

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the decimal 45 in binary? Give your answer as a byte.

A

00101101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the hexadecimal 2E in decimal?

A

46

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the hexadecimal in binary? Give your answer as a byte.

A

01000101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which data type stores just TRUE and FALSE?

A

Boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is -5 in sign magnitude binary? Give your answer as a nibble.

A

1101

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the binary 01101100 represent in hexadecimal?

A

6C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the effect of a logical shift left by one place?

A

The value is doubled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the two’s complement binary 10101101 in decimal?

A

-83

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The binary 0011010000110 is a floating point number with a single-bit sign, 8-bit mantissa and 4-bit exponent. What is the number in decimal?

A

52

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Perform a logical shift right two places on the binary number 01101010 and convert your result to decimal.

A

26.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Perform an XOR masking on the binary numbers:
01010101
10111011

A

11101110

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
Which of the following is not a character?
A) 8
B) R
C) %
D) 43
A
  • D) 43
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The binary 1100110000011 is a floating point number with a single bit sign, 8 bit mantissa and 4 bit exponent. What is the number in decimal?

A

-9.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an array?

A
  • An ordered, finite set of elements of a single type.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What type of array is a linear array?

A
  • A one dimensional array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How can you visualise a two dimensional array?

A
  • You can visualise it as a spreadsheet/table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can you visualise a three dimensional array?

A
  • A three dimensional array can be visualised as a multi-page spreadsheet
22
Q

What is a record also known as?

A
  • A row in a file
23
Q

What is a record made up of?

A
  • A record is made up of fields
24
Q

How can you select a field from a record using pseudocode?

A

-recordName.fieldName

25
Q

What is the definition of a list?

A
  • A data structure consisting of a number of items, where the items can occur more than once.
26
Q

What are the main differences between arrays and lists?

A
  • Lists can store data non-contiguously whereas array store data in order.
  • Lists can store data of more than one data type.
27
Q

What is a tuple?

A
  • An immutable, ordered set of values of any type.
28
Q

What is the difference between a tuple and an array?

A
  • Tuples are initialised using regular brackets instead of square brackets.
29
Q

What is a stack?

A
  • A last in first out data structure, where items can only be removed from and added to the top of the list.
30
Q

Give an example of where stacks may be used.

A
  • Back button in a web page

- Undo buttons (ctrl z)

31
Q

What is a queue?

A
  • A first in first out data structure, where items are added to the end of the queue and removed from the front of the queue.
32
Q

What does the operation isEmpty() do?

A
  • Check to see if the stack is empty
33
Q

What does the operation push(value) do?

A
  • Adds a new value to the top of the stack
34
Q

What does the operation peek() do?

A
  • Returns the top value of the stack without removing it
35
Q

What does the operation pop() do?

A
  • Returns and removes the value at the top of the stack
36
Q

What does the operation size() do?

A
  • It returns the size of the stack
37
Q

What does the operation isFull() do?

A
  • Checks to see if the stack is full.
38
Q

What does the operation enQueue(value) do?

A
  • Adds the value to the end of the queue
39
Q

What does the operation deQueue() do?

A
  • Removes the item from the end of the queue
40
Q

What does the operation isEmpty() do?

A
  • It checks to see if the queue is empty
41
Q

What does the operation isFull() do?

A
  • Checks to see if the queue is full
42
Q

Simplify the following Boolean expression:

!B . !(A+B)

A
  • !B . !A
43
Q

What Boolean operation is represented with an overline?

A
  • NOT
44
Q

Which has the highest order of precedence? AND, OR or NOT?

A

NOT

45
Q

Complete the Boolean identity:

C . C =?

A

C

46
Q

Which Boolean operation is represented with a dot?

A

AND

47
Q

Simplify the following Boolean expression:

(C + (B + !B)) . D

A

D

48
Q

Complete the Boolean identity:

B . 1 = ?

A

B

49
Q

Apply one of DeMorgan’s Laws to the following Boolean expression:
!A . !B

A

!(A+B)

50
Q

Which Boolean operation is represented with a plus?

A

OR

51
Q

Apply one of DeMorgan’s Laws to the following Boolean expression:
!(A . C)

A

!A + !C

52
Q

Apply a distributive rule to the following Boolean expression:
B , (A+C)

A

B.A + B.C