2.2) Algorithms Flashcards
What is an algorithm?
Process used to solve problem or achieve task.
What is an algorithm judged by?
Whether completes task or solves problem in most efficient way.
Efficient algorithm only uses resources necessary to complete task no > no
What is an algorithm generally made up of?
Input-process-output.
What is an algorithm tracked using and what do they do?
Trace tables.
Trace progress of computer through code.
What is efficiency?
Extent to which task completed in shortest possible amount of code. Also relates to amount of memory used + speed of execution of code.
What are trace tables?
Template helps follow each instruction in program.
What is a flowchart?
Visual way to plan program through sequence of events.
What is decomposition?
Breaks a task into smaller tasks.
What does decomposition do?
Helps write code as easier to write code each section at time, alternative to writing whole in 1 go.
Makes life easier when testing code as can test section before running all together.
What is abstraction?
Way remove unneeded info from task so computer can complete it.
What is searching?
Basic + common task for algorithm.
2 types= binary + linear.
What does binary search do?
Chooses middle value in sorted array.
Works out whether value sought higher or lower than middle value.
Splits array again to check again.
List repeatedly split in half and half until item located.
Is the binary search method used in real life?
Yes.
What is an array?
Set of data items of same type grouped together using 1 identifying label or identifier.