Data Structures Part 1 Flashcards

1
Q

Serial File

A

A serial file is one where the records are read in the order in which they are written. New records are added to the end of an existing file.

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

Sequential file

A

A sequential file is a serial file where the records are in order of the key field. The key field uniquely identifies a record. An example of a sequential file is a sorted transaction file.

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

Mask

A

A mask can be used to select particular bits.

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

ASCII

A

A common way of using 7 (or 8) bits to represent characters.

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

Binary Number

A

A number in base 2 using just the digits 0 and 1.

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

Bit

A

Binary Digit - the smallest unit of storage - a single 1 or 0.

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

Collision

A

In a hash file a collision occurs when the hash functions gives the same record position for two records.

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

Direct Access File

A

A file where any record can be accessed without having access it’s preceding records.

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

Exponent

A

The storage of position of the point in a floating point number.

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

File

A

A collection of records stored on backing store (tape/disk).

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

File processing

A

performing an operation (e.g. update) on each record in a file.

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

File update

A

The process of changing the contents of a file.

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

Fixed Point

A

A way of representing a whole number and a faction where the number of bits allocated to each is fixed.

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

Floating Point

A

A way of representing a whole number and fraction where the position of the point is stored separately.

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

Fully indexed file

A

A direct access file where every record has an entry in the index.

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

Hash File

A

A file where a calculation is applied to a key field value in order to give the position of the record in a direct access file. Usually modding by the amount of records.

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

Hash function

A

The calculation that is used to convert a key field value into a position in a file.

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

Hexadecimal

A

A substitution that replaces a group of 4 bits by a single character 0..9,A,B,C,D,E,F. Used to make binary number easier for humans to understand.

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

Index File

A

A direct access file where the key fields and the location of the records are stored in an index (usually held in RAM for fast searching).

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

Main memory

A

The fast memory used for holding data that is being processed and programs that are being executed.

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

Overflow

A

The attempt to store a number that is too large.

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

Normalising (numbers)

A

With floating point numbers making sure the mantissa is between 0.5 and 1 (to ensure the greatest accuracy).

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

Mantissa

A

The storage of the digits in a floating point number

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

Exponent

A

The storage of position of the point in a floating point number.

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

Random Access File

A

A file where a record can be accessed directly using the key which corresponds to the position in the file.

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

Range

A

The highest and lowest values that can be represented.

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

Rehash

A

The process of restructuring a hash file so that it can hold more records.

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

Relational files

A

Two or more files where a field of one file (foreign key) refers to a key field of a record in a different file.

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

Rounding

A

Rounding is the process of representing a truncated value by the closest possible value.

30
Q

Sign and magnitude

A

The left hand bit can be used to represent the sign of the number (0 for +, 1 for -), the remainder of the bits used represents magnitude (side) of the number.

31
Q

Signed numbers

A

Signed numbers can be either positive or negative indicated by a preceding sign.

32
Q

Terminal Value

A

A dummy record used to indicate the end of a file.

33
Q

Transaction file

A

A file containing all the changes that need to be made to a master file.

34
Q

Truncation

A

When the number of bits needed is larger than the number of bits available.

An error introduced by the inability to store some of the fractional bits. In truncation digits are simply cut off.

35
Q

Two’s complement

A

A common way of representing signed numbers.

36
Q

Underflow

A

An error where the number is too small to be distinguished from 0.

37
Q

Unicode

A

A way of representing a character as a pattern of 16 bits. Based on ASCII but allows for 65536 different character

38
Q

Offset record numbers

A

Might prefer to use 5 digits instead of starting with 0. E.g. 10000, where you’d have to subtract by 1000.

39
Q

Offset record number advantage

A

Prevent people from knowing how big the organisation is

40
Q

Offset record number disadvantage

A

Leaves gaps and wastes space.

41
Q

Hash File: What do you do it it’s occupied?

A

Go to the one above.

42
Q

Hash File: Why might it not be stored?

A

Because the file is full.

43
Q

Hash File: How might a full file be detected?

A

Serial search, looping through all positions. If all positions are occupied, then display an error.

44
Q

Hash File: Why might a record not be found?

A

Because it doesn’t exist.

45
Q

Hash File: When is it suitable?

A

When the key field is not a suitable numeric value or is non-numeric.

46
Q

Hash File: Best way to create a key

A

MOD % by amount of record positions

47
Q

Hash File: File Efficieny

A

As the file becomes full so the likelihood of clashes increases. The greater chance of a clash, the greater the average time taken to access a record. Best rule is to keep it half full, after it becomes two thirds full, the efficiency is impaired to rehash.

48
Q

AND

A

0 | 0 = 0
0 | 1 = 0
1 | 0 = 0
1 | 1 = 1

49
Q

OR

A

0 | 0 = 0
0 | 1 = 1
1 | 0 = 1
1 | 1 = 1

50
Q

NOT

A
0 = 1
1 = 0
51
Q

XOR

A

0 | 0 = 0
0 | 1 = 1
1 | 0 = 1
1 | 1 = 0

52
Q

Advantage of Standard Code/ASCII

A

It’s understood by every software.

53
Q

Overflow: When can it not occur?

A

If sign A is different from sign B

54
Q

Overflow: When has it not occurred?

A

If sign A = Sign B and result has Sign A

55
Q

Fixed Point: Disadvantage

A

Since the position of the point must be agreed in advance, this means a decision must be made as to the number of bits to the left and the number of bits to the right.

56
Q

Floating Point: Advantages

A

Can store fractional values

For a given number of bits, stores a greater range of numbers.

57
Q

Floating Point: Disadvantages

A

Numbers are stored as approximations

Calculations are slower because of the complex format

58
Q

Integer: Advantages

A

Numbers stored with total accuracy.

Fast Calculations

59
Q

Integer: Disadvantages

A

For given number stores a lesser range of numbers.

Can only store whole numbers.

60
Q

Logical Shift Left

A

Move every digit to the left one place, causing the digit on the left to fall off. Add a 0 on the right.

61
Q

Logical Shift Right

A

Move every digit to the right one place, causing the digit on the right to fall off. Add a 0 on the left.

62
Q

Arithmetic shift left

A

BOOK

63
Q

Arithmetic shift right

A

BOOk

64
Q

Logical Shift Left: Effect

A

Times 2x (power of 2 by amount of shifts)

65
Q

Logical Shift Right: Effect

A

Divide 2x (power of 2 by the amount of shifts)

66
Q

Arithmetic shift right: Effect

A

Times 2x on 2’s compement (power of 2 by amount of shifts)

67
Q

Arithmetic shift left: Effect

A

Divide 2x on 2’s compement (power of 2 by the amount of shifts)

68
Q

Positive Mantisa

A

http://i.imgur.com/ORf43QH.png

69
Q

Negative Mantisa

A

http://i.imgur.com/cqb0pY8.png

70
Q

Problems with Truncation and Rounding

A

When truncated numbers are used in calculations then error can accumulate and create large errors.