What is a syntax error?
• An error that breaks the rules of the language
• The program will not run
What is a logic error?
• An error that gives the wrong result
• The program can still run
What is a searching algorithm?
• An algorithm used to find a target value in a list
What is linear search?
• A search that checks each item one by one
What type of list can linear search be used on?
• Any list
• Sorted or unsorted
What are the advantages of linear search?
• Easy to write
• Works on unsorted data
What is the main disadvantage of linear search?
• It is slow on large lists
What is binary search?
• A search that repeatedly checks the middle of a sorted list
What must be true before binary search can be used?
• The list must be sorted
Why is binary search faster than linear search?
• It halves the list each step
What are the disadvantages of binary search?
• More complex
• Only works on sorted data
What does ‘divide and conquer’ mean in binary search?
• The list is split in half each step