AeroLab Reading room

CS / A2 level

Floating point and data structures

Floating-point normalisation gives a conventional mantissa form and efficient use of precision. Finite representation creates rounding error, overflow and underflow; cancellation can amplify relative error.

Learning objectives

The big idea

Floating-point normalisation gives a conventional mantissa form and efficient use of precision. Finite representation creates rounding error, overflow and underflow; cancellation can amplify relative error.

Abstract data types describe operations independently of implementation. Linked lists, trees, graphs and hash tables support different access patterns and memory trade-offs.

Worked example

A binary search tree has root 8 and left child 3. Insert 5. Where does it go?

Follow the solution

5<8 takes the left branch; 5>3 takes the right branch of 3.

Investigate and explain

Predict the worked result before calculating. Change one input, record the new result, and explain which assumptions still hold.

Use the prediction activity below; a local model appears only where it supports this topic.

Open the interactive investigation

Check your understanding

1. Does hashing guarantee no collisions?

  1. Yes
  2. No
  3. Only with integer keys
Check the answer and reasoning

No

Distinct keys may map to the same finite hash location and require collision handling.

2. A binary search tree has root 8 and left child 3. Insert 5. Where does it go?

  1. Right of 8
  2. Left of 3
  3. Right of 3
Check the answer and reasoning

Right of 3

5<8 takes the left branch; 5>3 takes the right branch of 3.

3. Can subtracting two nearly equal rounded numbers lose relative precision?

  1. Yes
  2. No
  3. Only in decimal arithmetic
Check the answer and reasoning

Yes

Cancellation removes leading shared digits, exposing the uncertainty in the remaining difference.