0% found this document useful (0 votes)
3 views4 pages

Algorithm Design Notes Word Format

This document covers Algorithm Design and Problem-solving in Cambridge International AS & A Level Computer Science. It introduces computational thinking skills such as abstraction and decomposition, and explains algorithm design through stepwise refinement, pseudocode, and flowcharts. Additionally, it evaluates searching and sorting algorithms, discussing their efficiency in terms of time and space complexity.

Uploaded by

kamransharwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Algorithm Design Notes Word Format

This document covers Algorithm Design and Problem-solving in Cambridge International AS & A Level Computer Science. It introduces computational thinking skills such as abstraction and decomposition, and explains algorithm design through stepwise refinement, pseudocode, and flowcharts. Additionally, it evaluates searching and sorting algorithms, discussing their efficiency in terms of time and space complexity.

Uploaded by

kamransharwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Cambridge International AS & A Level

Computer Science 9618 (2024/2025)


Topic 9: Algorithm Design and Problem-solving

What You’ll Learn in This Chapter


 Use of computational thinking skills such as abstraction and decomposition.
 Designing algorithms through stepwise refinement and logic statements.
 Representing algorithms using pseudocode and flowcharts.
 Understanding and implementing searching and sorting algorithms.
 Evaluating algorithm efficiency using time and space complexity.

9.1 Computational Thinking Skills

Abstraction
Definition: Abstraction is simplifying a problem by focusing on essential details and
ignoring the irrelevant ones.

Real-World Example: Google Maps ignores buildings and trees; it focuses only on roads and
intersections.

Benefits of Abstraction:

 Reduces complexity.
 Focuses on key ideas.
 Promotes reusability.

Decomposition
Definition: Decomposition involves breaking down a complex problem into smaller,
manageable sub-problems.

Real-World Example: Building a website involves designing UI, coding backend, and
creating a database.

Comparison: Abstraction vs. Decomposition


Skill What It Does Example
Abstraction Focuses on essential City as a dot on a map
elements only
Decomposition Breaks down a task into Website = UI + Backend +
subtasks Database
9.2 Algorithms
Definition: An algorithm is a step-by-step set of instructions designed to perform a
specific task.

 Correctness: Produces the right output for all valid inputs.


 Efficiency: Uses minimal time and memory.
 Clarity: Easy to understand and follow.

Stepwise Refinement
Definition: A top-down design approach, refining a broad problem into detailed steps.

Example Task: Calculate the average of a list of numbers

 High-Level: Get numbers → Sum numbers → Count them → Divide → Display result
 Refined: Initialize sum, loop through list, add values, divide, and return average

Logic Statements
These statements use conditions (like IF) to determine the flow of logic.

Example:
IF number > 0 THEN
OUTPUT 'Positive'
ELSE
OUTPUT 'Not Positive'

Pseudocode
Pseudocode Example: Find the maximum value in a list
FUNCTION findMax(list):
max = list[0]
FOR each element IN list:
IF element > max:
max = element
RETURN max

Searching Algorithms
Comparison of Linear and Binary Search:

Algorithm Description Best Use


Linear Search Checks each element one- Small/unsorted lists
by-one
Binary Search Divides sorted list Large/sorted lists
repeatedly
Sorting Algorithms
Comparison of Bubble Sort and Insertion Sort:

Algorithm Steps Best Use


Bubble Sort Swaps adjacent items Small/nearly sorted lists
repeatedly
Insertion Sort Inserts items into a sorted Small/partly sorted lists
section

Algorithm Efficiency
Algorithm Time Complexity Space Complexity
Linear Search O(n) O(1)
Binary Search O(log n) O(1)
Bubble Sort O(n²) O(1)
Insertion Sort O(n²) O(1)
Exercises to Practice
1. 1. Explain how a weather app uses abstraction.
2. 2. Break 'cooking dinner' into decomposable steps.
3. 3. Write pseudocode to find the smallest number in a list.
4. 4. Draw a flowchart for linear search.
5. 5. Why is binary search more efficient than linear search for large sorted data?

You might also like