| Binary | Hex | Decimal |
|---|---|---|
| 0000 0000 | 00 | 0 |
| 0000 0001 | 01 | 1 |
| 0000 0010 | 02 | 2 |
| 0000 0011 | 03 | 3 |
| 1111 1111 | FF | 255 |
Example: 10110110₂ = B6₁₆ = 182₁₀
640 × 480 × 24 bits = 7 372 800 bits ≈ 0.88 MB.| Type | Method | Typical Use |
|---|---|---|
| Lossless | ZIP, PNG, FLAC | Text files, executables, archival storage |
| Lossy | JPEG, MP3, MPEG‑4 | Photos, music, video streaming |
| Header | Payload (data) | Trailer |
|--------|----------------|---------|
| source address, destination address, control bits | user data | error‑check bits (e.g., CRC) |
Plaintext: ATTACK
Shift +3 → Ciphertext: DWWDFN
(Each letter is moved three positions forward in the alphabet; wraps from Z to A.)| Unit | Symbol | Bits | Bytes |
|---|---|---|---|
| bit | b | 1 | 0.125 |
| byte | B | 8 | 1 |
| kilobyte | KB | 8 192 | 1 024 |
| megabyte | MB | 8 388 608 | 1 048 576 |
| gigabyte | GB | 8 589 934 592 | 1 073 741 824 |
Memory hierarchy (fast → slow)
| Layer | Description | Examples |
|---|---|---|
| Firmware | Low‑level code stored in ROM/flash; initialises hardware and starts the OS. | BIOS, UEFI, router firmware |
| Operating System (OS) | Manages resources, provides services (file system, multitasking, security). | Windows, macOS, Linux, Android |
| System software | Utilities that support the OS and applications. | Device drivers, file managers, antivirus |
| Application software | Performs user‑oriented tasks. | Word processors, web browsers, games |
| Aspect | High‑level language | Low‑level language |
|---|---|---|
| Abstraction | Close to English (Python, Java, Pascal) | Close to machine code (Assembly, machine language) |
| Portability | Generally portable across platforms | Hardware‑specific |
| Typical use | Application development, rapid prototyping | System programming, device drivers, performance‑critical code |
| Feature | Compiler | Interpreter |
|---|---|---|
| Translation | Whole source → machine code before execution | Source executed line‑by‑line at run‑time |
| Speed | Fast execution (code already compiled) | Slower execution (translation on the fly) |
| Error detection | All syntax errors caught before run‑time | Errors detected as each line is executed |
| Examples | C, C++, Java (javac) | Python, BASIC, JavaScript (node) |
protocol://host[:port]/path?query#fragment
https://www.example.com:443/articles?id=7#section2
| Threat | Typical Impact | Mitigation |
|---|---|---|
| Malware (virus, trojan, ransomware) | Data loss, system damage | Antivirus, regular updates, avoid suspicious downloads |
| Phishing | Credential theft | User education, verify sender, email filters |
| Unauthorised access | Data breach | Strong passwords, 2‑factor authentication, firewalls |
| Denial‑of‑Service (DoS/DDoS) | Service interruption | Rate limiting, intrusion‑prevention systems, CDN |
| Man‑in‑the‑middle (MITM) | Data interception/modification | HTTPS/TLS, VPNs, certificate validation |
| Weak encryption | Data can be read or altered | Use strong algorithms (AES‑256, RSA‑2048), avoid deprecated protocols (SSL v2/v3) |
IF … THEN … END IF, FOR … TO … NEXT, WHILE … DO … END WHILE.totalScore).// (single line) or /* … */ (block).Exam‑style description: examines each element in order until the target is found or the list ends.
FOR i FROM 0 TO n‑1
IF list[i] = target THEN
RETURN i // index of target
END IF
NEXT i
RETURN -1 // not found
Complexity
O(n)O(1) (target is first element)O(1)
low ← 0
high ← n‑1
WHILE low ≤ high
mid ← (low + high) DIV 2
IF list[mid] = target THEN
RETURN mid
ELSE IF list[mid] < target THEN
low ← mid + 1
ELSE
high ← mid – 1
END IF
END WHILE
RETURN -1
Complexity
O(log n)O(1) (iterative version)
REPEAT
swapped ← FALSE
FOR i FROM 0 TO n‑2
IF list[i] > list[i+1] THEN
SWAP list[i] AND list[i+1]
swapped ← TRUE
END IF
NEXT i
UNTIL swapped = FALSE
Complexity
O(n)O(n²)O(1) (in‑place)
FOR i FROM 1 TO n‑1
key ← list[i]
j ← i‑1
WHILE j ≥ 0 AND list[j] > key
list[j+1] ← list[j]
j ← j‑1
END WHILE
list[j+1] ← key
NEXT i
Complexity
O(n)O(n²)O(1)
FOR i FROM 0 TO n‑2
minIndex ← i
FOR j FROM i+1 TO n‑1
IF list[j] < list[minIndex] THEN
minIndex ← j
END IF
NEXT j
SWAP list[i] AND list[minIndex]
NEXT i
Complexity
O(n²)O(1)O(n²) Sorts| Task | Pseudocode pattern | Typical use‑case |
|---|---|---|
| Totalling (sum) |
total ← 0
FOR i FROM 0 TO n‑1
total ← total + list[i]
NEXT i
| Sum of sales figures, exam scores, distances. |
| Counting (frequency) |
count ← 0
FOR i FROM 0 TO n‑1
IF condition(list[i]) THEN
count ← count + 1
END IF
NEXT i
| Number of students who passed, items above a threshold. |
| Finding maximum / minimum |
max ← list[0]
FOR i FROM 1 TO n‑1
IF list[i] > max THEN
max ← list[i]
END IF
NEXT i
| Highest score, largest sale, earliest date. |
| Average (mean) |
total ← 0
FOR i FROM 0 TO n‑1
total ← total + list[i]
NEXT i
average ← total / n
| Mean temperature, average speed. |
| Search & replace |
FOR i FROM 0 TO n‑1
IF list[i] = oldValue THEN
list[i] ← newValue
END IF
NEXT i
| Update a grade, correct a typo in a data set. |
O(1)O(log n)O(n)O(n log n)O(n²)O(2ⁿ)O(n)”).Create an account or Login to take a Quiz
Log in to suggest improvements to this note.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.