2.1 - Elements of Computational Thinking (2.1.1-1.2) Flashcards

1
Q

Define Abstraction. (2 Definitions)

A
  • Abstraction is the process of separating ideas from reality
  • It is a means of hiding unnecessary details to focus on the main purpose of a problem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Subcategories of Abstraction

A
  • Data abstraction - When details about how data is being stored are hidden
  • Representational Abstraction - Analysing what is relevant to a given scenario and simplifying a problem based on this information.
  • Abstraction by Generalisation - Involves grouping together similarities within a problem to identify what kind of problem it is
  • Procedural Abstraction - Models what a subroutine does without considering how this is done
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

State two advantages of using Abstraction in Software Development.

A
  • Easier for programmers to focus on the main purpose of a program; thus reducing the time needed to spend on the project
  • Reduces the complexity of programming; thus reduces memory and processing requirements
  • Prevents program from becoming unnecessarily large
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where can we see Abstraction in Computer Science?

A
  • Applications
  • Networks
  • Operating Systems
  • Data Structures
  • Databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Potential Dangers of Abstraction

A
  • Potential ‘Over-Abstraction’ which can lead to details that are actually important being removed
  • Too much abstraction can detract from the engagement and appeal of programs like games as they may be too simplistic
  • May make some simulations not realistic enough
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

General Premise of Thinking Ahead

A
  • Thinking ahead about the different components of a problem and the best way to handle them; allowing developers to consider potential problems or difficulties that could arise.
  • Taking these factors into account early allows developers to design strategies to make programs easy and intuitive to use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Precondition?

A

Preconditions are requirements which must be met before a program can be executed. If the preconditions are not met, the program will fail to execute or return an invalid answer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Advantages of Stating Preconditions in Documentation of a function

A
  • Reduces length and complexity of program
  • Easier to debug and maintain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the preconditions of binary search tree?

A

Data must be stored in a tree structure and ordered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the preconditions of binary search?

A

Data must be in order and must be in a structure where elements can be directly accessed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the preconditions of linear search?

A

Data must be in a structure that is iterable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are reusable Program Components and how they are used when developing large programs

A
  • Commonly used functions that can be identified when a problem is split into components
  • Software is modular (E.g. object/function) and these modules can be transplanted into new software or shared at run time through the use of program libraries.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advantages of Reusable Program Components

A
  • Makes programs easier to maintain as sections can be tested independently and updates to a specific module will update all parts of a program that use it
  • Will save time as code doesn’t have to constantly be re-written
  • Modules of code have already been tested; code is more reliable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Caching?

A

It is temporary storage of program instructions or data (that have been used recently and may be used again) in cache; allowing for quicker access for future use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is Prefetching?

A

Where an algorithm predicts which instructions or data are likely to be required by a program. The data likely to be needed next is fetched and stored in a cache ready to be used by the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Advantages of Caching (in Web Pages)

A
  • Reduces load on webserver; less requests from the server back to the web server
  • Frees bandwidth as images and text do not have to be downloaded again multiple times when being loaded
  • Less time is spent waiting
17
Q

Drawbacks of Caching

A
  • Effectiveness is dependant on size of cache and how often cached data is used; too small would make it ineffective but too big would mean a lot of data can be stored which would increase search times
  • The wrong data being cached and having to be flushed can make sequence of data in cache harder to maintain
18
Q

Advantage and Drawback of Prefetching

A
  • ADV - Minimising delays waiting for data or instructions to be fetched from storage.
  • DIS - Highly accurate but complicated algorithms must be used; as they can only provide a prediction of which instructions are likely to be used and there is no guarantee that this will be right