Computaitional Thinking 2.1 Flashcards
What is abstraction?
Abstraction is the process of removing unnecessary detail to create a representation of reality.
What is prefetching?
Technique where Instructions are fetched based on algorithms, which predict what instructions are likely to soon be used, predicts what data will be needed next and loads data into cache before it is needed.
State two advantages of using abstraction.
- Saves time and resources
- Removes unnecessary complexity.
What is the purpose of thinking ahead?
To make programs easy and intuitive for users to use.
What is a computer system
Any system in which data can be inputted, processed, and outputted.
Define input
Any data that is entered or received by a computer
State three types of inputs
Keyboard, mouse, touch screen, microphones
Define output
The results are passed back once the input has been processed.
State three types of outputs
Monitor, printer, speaker, projector
What are preconditions?
Requirements that must be met before a program can be executed.
State one example of a precondition.
- Queues - check that the queue is not full before adding another item
- root function - check that the number is not negative
Where can a precondition be defined?
Before the code is executed e.g before a loop
Define caching
Storing instructions or values in cache memory after they have been used, as they may be used again.
State an advantage of caching
- Cache memory is faster than main memory
- It stores data for temporary use
How is caching used in storing web pages?
Web pages that are often visited are cached, so the next time a web page is visited it will be loaded without delay