Back to the full dot-point answer
WalesComputer ScienceQuick questions
Unit 1 Fundamentals of Computer Science
Quick questions on Algorithms: design, searching, sorting and efficiency - WJEC A-Level Computer Science
5short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is designing an algorithm?Show answer
Good algorithm design uses the three control structures (sequence, selection, iteration), validates its inputs, and is decomposed into manageable sub-problems. Designing first and coding second means errors are caught early, when they are cheap to fix.
What are searching algorithms?Show answer
A linear search examines each item in turn until the target is found or the list ends; it works on any list but is slow for large data. A binary search works only on a sorted list: it examines the middle item, then discards the half that cannot contain the target, repeating until found. Halving the list each step makes binary search dramatically faster on large data.
What is comparing efficiency?Show answer
Efficiency is measured by how the number of operations grows as the input grows, captured by Big-O notation: linear search is O(n), binary search is O(log n), bubble and insertion sort are O(n squared), and merge sort is O(n log n).
What is q1?Show answer
State the worst-case Big-O time complexity of a linear search and of a binary search. [2 marks]
What is q2?Show answer
A bubble sort is applied to the list 3, 1, 2. State the list after the first complete pass. [2 marks]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.