Evaluating Efficiency (4 marks)
What affects a sorting algorithm’s efficiency? Discuss simple sorting algorithms, such as bubble sort and merge sort to help with your explanation.
Evaluating Efficiency (4 marks) Read More »
What affects a sorting algorithm’s efficiency? Discuss simple sorting algorithms, such as bubble sort and merge sort to help with your explanation.
Evaluating Efficiency (4 marks) Read More »
Given the following algorithm segment: START For each number in list Set total to 0 Add number to total End For Display total END A logic error has caused the algorithm to always display the last value of the list. Correct the logic error in the algorithm.
Logic Error Identification (2 marks) Read More »
Identify three types of logic errors that can occur in a program.
Logic Errors (3 marks) Read More »
Explain the difference between a syntax error and a runtime error.
Syntax vs Run-Time (2 marks) Read More »
Explain the concept of the ‘divide and conquer’ strategy as used in the merge sort algorithm.
Merge Sort Concept (2 Marks) Read More »
What is a precondition for using a binary search algorithm on an array, and why is this precondition necessary?
Binary Search Precondition (2 Marks) Read More »
Write the steps of the bubble sort algorithm used to sort an array in ascending order.
Bubble Sort Algorithm Steps (4 Marks) Read More »
Describe how a linear search algorithm works to find a target value in a one-dimensional array.
Explain Linear Search Algorithm (2 Marks) Read More »
Given the following algorithm fragment in pseudocode: SET x TO 5 SET y TO x + 2 SET x TO y + 3 What is the value of x at the end of the execution?
Reading Algorithms: Assignment (1 marks) Read More »
An algorithm uses a counter count and a total accumulator total. The algorithm adds up numbers from 1 to a given limit. The pseudocode is as follows: SET count TO 1 SET total TO 0 WHILE count
Reading Algorithms: WHILE Loop (2 marks) Read More »