Skip to main content

Coding Worksheet - A-Level - Intermediate

Coding worksheet for A-Level / Vocational (Ages 16-18). Intermediate level computing practice, aligned to the UK National Curriculum. Print-ready with answer key included.

Computingโ€ขA-Level / Vocational (Ages 16-18)โ€ขCodingintermediate
0 views
0 downloads

Intermediate Coding Concepts and Algorithms

Ages 16-18, Intermediate Level

Name:
Date:
Score:
/6

Instructions: This worksheet explores key coding concepts and algorithms relevant to A-Level Computing. You will engage with various activities designed to enhance your understanding of computational thinking, data structures, and algorithm efficiency.

1

Algorithm Complexity Analysis

Analyse the time complexity of the following algorithms. Identify the Big O notation for each and provide a brief explanation of your reasoning.

1. A function that iterates through an array once and performs a constant-time operation on each element.

2. A recursive function that splits an array into two halves and recursively processes each half.

3. A nested loop where the inner loop runs n times for each iteration of the outer loop, which also runs n times.

2

Data Structure Identification

For each description below, identify the most suitable data structure. Justify your choice based on the properties of the data structure.

1. A collection where elements are accessed in a Last-In-First-Out manner.

2. A structure that allows fast insertion, deletion, and lookup of elements by key.

3. A structure used to represent hierarchical data with parent-child relationships.

3

Graph Algorithm Application

Apply Dijkstra's algorithm to find the shortest path from node A to all other nodes in the graph below. List the shortest path and its cost for each node.

NodePathCostA
0B__C
__D__

1. Path to Node B:

2. Path to Node C:

3. Path to Node D:

4

Sorting Algorithm Comparison

Compare the time complexity of the following sorting algorithms. Explain which algorithm is more efficient under different conditions.

1. Bubble Sort vs. Quick Sort:

2. Insertion Sort vs. Merge Sort:

5

Programming Paradigms

Match each programming paradigm with its key characteristic. Draw lines to connect the paradigms with their descriptions.

๐Ÿ“š Procedural --- ๐Ÿ“š Focuses on functions and procedures
๐Ÿ“š Object-Oriented --- ๐Ÿ“š Utilises objects and classes
๐Ÿ“š Functional --- ๐Ÿ“š Emphasises immutability and pure functions
6

SQL Query Construction

Write SQL queries for the following tasks. Ensure your queries are efficient and make use of appropriate SQL features.

1. Select all records from a table 'Students' where the grade is above 80.

2. Update the 'Salary' field in the 'Employees' table by increasing it by 10% for all employees in the 'Sales' department.

Answer Key

Activity 1: O(n) ; O(n log n) ; O(nยฒ)

Activity 2: Stack ; Hash Table ; Tree

Activity 3: Path to Node B: A -> B ; Path to Node C: A -> C ; Path to Node D: A -> D

Activity 4: Quick Sort is more efficient for large datasets ; Merge Sort is more efficient for large datasets

Activity 5: Procedural --- Functions and procedures ; Object-Oriented --- Objects and classes ; Functional --- Immutability and pure functions

Activity 6: SELECT * FROM Students WHERE grade > 80 ; UPDATE Employees SET Salary = Salary * 1.1 WHERE department = 'Sales'

Want a customised worksheet?

Create your own AI-generated worksheet tailored to your exact needs.