2.1 Flashcards
(13 cards)
Advantages of problem decomposition (2)
Making problems easier to solve
Different people can work on different parts of a problem at the same time reducing development time
Program components developed in one program can easily be used in other programs
What is algorithmic thinking (2)
Is a way of getting to a solution by identifying the individual steps needed.
By creating a set of rules, an algorithm is followed precisely leads to an answer
What do you need to think about when performing algorithmic thinking (4)
- Break the problem down
- Thinking about what data is important
-What data is not important
-Think about the relevant data structures
-Tackle each part of the problem step by step
What do you need to consider when creating the input part of a program (3 )
- Anything which needs to be supplied to the program so it can meet its goals
-That it is often input by the user
-Consider an appropriate variable name and data type for the input
What do you need to consider when creating the processing part of a program (2)
- Consider what calculations need to be performed while the program is running
-Does data need to change formats or data types
What do you need to consider when creating the outputting part of a program (2)
- Consider what your program needs to output
- Consider what form this output needs to take
- Consider an appropriate variable name and data type for any output
What is one method of designing a solution to a problem
A structure diagram
What do structure diagrams illustrate
They illustrate problem decomposition
What method is used to create structure diagrams
Step-Wise refinement
What does a structure diagram do
illustrates decomposition of small components into smaller components.
Requirements of the lowest nodes of a structure diagram
Achieve a single task
Order of how a binary search works (5)
- Calculate a mid point in the data set
2.Check if that is the item to be found if not.
- Check if the item you are looking for is higher or lower than the midpoint
- If lower than midpoint remove all higher data from the binary search. Vice versa
- Repeat process 1-4
Order of linear search
Identify a search term.
Look at the first item in the list.
Compare the item with the search term.
Is the current item the same as the search term? If so, the item has been found. If not, move to the next item.
Repeat from step two until the last item in the list has been reached.
If the end of the list has been reached and the search term has not been found, then the search term is not in the list and the algorithm can stop.