A program is an algorithm written in a programming language
An algorithm is a set of instructions that can be followed to solve a problem or perform a task
Computers only understand binary code (0s and 1s).
Bubble sort is an algorithm that sorts a list of items in order by comparing each item to the next
The bubble sort algorithm works by repeatedly swapping adjacent elements if they are in the wrong order.
In the first iteration, it compares the first two elements and swaps them if necessary. It then moves on to compare the second and third elements, and so on until all pairs have been compared.
abstraction is the process of removing unnecessary details from a problem to simplify it and make it easier to solve
A programmer uses abstraction when writing code because it allows them to focus on solving the main problem rather than getting bogged down in irrelevant details.
decomposition in computer science is the process of breaking down a problem into smaller sub-problems
Decomposition helps us understand complex problems by dividing them into simpler parts that can be tackled one at a time.
This approach makes it easier to develop solutions as we can tackle each part separately without being overwhelmed by the complexity of the whole problem.
A syntax error is when a mistake is made that does not allow the program to run.
A logic error is when a mistake in the code is made but the program still runs, it might not say what you wanted it to say.
merge sort is a sorting algorithm that works by breaking down the list into two sublists and then sorting each sublist.