The Merge Sort Algorithm (2 marks)
Describe two characteristics of the merge sort algorithm.
The Merge Sort Algorithm (2 marks) Read More »
Describe two characteristics of the merge sort algorithm.
The Merge Sort Algorithm (2 marks) Read More »
Write an algorithm in pseudocode to check if a string entered by a user is a palindrome (a word that reads the same backward as forward). Your algorithm should use a subroutine to reverse the string and compare it with the original string to determine if it is a palindrome. Include appropriate self-documenting identifiers.
Subroutines and String Handling (6 marks) Read More »
Design an algorithm in pseudocode that calculates the factorial of a given non-negative integer n using iteration. The factorial (symbol: !) of a number is the product of all positive integers less than or equal to the number. For example, 5!=5×4×3×2×1=120.
Mathematical Operations and Counts (5 marks) Read More »
Below is an algorithm in pseudocode that is intended to find and output the largest number in a list called numberList. The list is populated with integer values. Declare largestNumber as integer set largestNumber = numberList[1] for i = 2 to len(numberList) if numberList[i] > largestNumber then set largestNumber = numberList[i] end if next i
Interpreting an Algorithm (3 marks) Read More »