2.1 - Elements of computational thinking Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is abstraction

A

Where a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency. It gets rid of unnecessary detail.

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

What will a computer scientist do when planning a system to “plan ahead”?

A

1) Determine outputs required
2) Determine the inputs necessary to achieve the outputs
3) Consider the resources needed
4) Consider user expectations

Anyone else can:
1) Decide what is to be achieved
2) Determine prerequisites
3) Determine what is possible

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

What is an example of thinking ahead in computers?

A

Caching
1) Data that is used is stored in the cache/RAM in case it is needed again.
2) Allows faster access for future use

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

What is decomposition?

A

Any large problem is divided into smaller sub-problems.

Eventually, they will equate to program modules or groups of modules.

Order of execution needs to be taken into account – may need data to be processed by one module before another can use it.

Some modules need to be accessible in an unpredictable way.

Large human projects benefit from the same approach.

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

What is concurrent thinking?

A

Concurrent thinking is the process of completing more than one task at any given time.

This doesn’t always mean that you have to be working on multiple tasks at once, however.

Concurrent processing is when tasks are given slices of processor time, to give the illusion that tasks are being performed simultaneously, and concurrent thinking is similar to this. It allows you to spot patterns and parts of problems where concurrency can be applied, thus speeding up processes.

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

What is the difference between concurrent processing and parallel processing?

A

Parallel processing is when multiple processors are used to complete more than one task simultaneously.

Meanwhile, concurrent processing is when each task is given a slice of processor time to make it look like the tasks are being completed simultaneously when in reality they are executed sequentially.

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

What are the benefits and drawbacks of concurrent processing?

A

Benefits of concurrent processing
● The number of tasks completed in a given time is increased.
● Less time is wasted waiting for an input or user interaction, as other tasks can be completed.

Drawbacks of concurrent processing
● Concurrent processing can take longer to complete when large numbers of users or tasks are involved as processes cannot be completed at once.
● There is an overhead in coordinating and switching between processes, which reduces program throughput.
● Just as with parallel processing, not all tasks are suited to being broken up and performed concurrently

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

What is representational abstraction?

A

A technique in which excessive details are removed to arrive at a representation of a problem that consists of only the key features.

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

Which form of abstraction involves grouping together similarities within a problem to identify what kind of problem it is?

A

Abstraction by generalisation

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

What is meant by data abstraction?

A

A form of abstraction in which details about how data is being stored are hidden.

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

What kind of problems make use of multiple levels of abstraction?

A

Large, complex problems

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

State two advantages of using abstraction in software development

A
  • Easier for programmers to focus on core elements
  • Reduces the time needed to be spent on the project.
  • Prevents program from getting unnecessarily large.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Give two applications of layers of abstraction

A

-Networking (TCP/IP layer)
- Programming languages

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

State two advantages of using abstraction in programming languages

A
  1. hiding information that is too complex or irrelevant
  2. more efficient software design
  3. reduces the time spent on the project and prevents
    the program from getting unnecessarily large
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What three considerations do programmers need to make regarding inputs and outputs when thinking ahead?

A
  • Method of input/output (device used)
  • Data structures used
  • Data types used
  • Order of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are preconditions?

A

Requirements which must be met before a program can be executed.

17
Q

Where can preconditions be defined?

A

Within the code or within documentation.

18
Q

Give an example where preconditions are required.

A

Stack functions
- Check that a stack is not empty when popping an element from a stack
- Check that a stack is not full when pushing an element onto a stack

19
Q

State two advantages of including preconditions within the documentation accompanying a subroutine.

A

Reduces the length of the program
- Reduces the complexity of the program
- Saves time needed to debug and maintain a longer program
- Makes subroutine more reusable

20
Q

What is the name given to the technique in which algorithms are used to predict which instructions are likely to soon be used?

A

Prefetching

21
Q

Give two examples of reusable program components.

A
  • Abstract data structures eg. queues and stacks
  • Classes
  • Subroutines
22
Q

What is the first stage of thinking procedurally

A

Taking the problem defined by the user and breaking it down into its constituent parts.

23
Q

What is the purpose of problem decomposition?

A

To make complex problems easier to solve and more manageable by allowing tasks to be divided between a group of people according to individual skill sets.

24
Q

State another name given to top-down design.

A

Stepwise refinement

25
Q

What is the purpose of top-down design?

A

Continually break problems down into subproblems until each subproblem can be represented as a single task and ideally a self-contained subroutine.

26
Q

What are the benefits of using top-down design?

A

● Problems can be solved and modules - developed by different people.
● Tasks can be tested separately - modules are self-contained

27
Q

What sort of problems is top-down design suited to?

A

Large, complex problems

28
Q

What is the second stage of thinking procedurally in software development?

A

Identifying components of a solution

29
Q

What must a software developer do before designing a subroutine to solve a particular problem?

A
  1. If its possible to make
  2. if it has already been made
30
Q

What do software developers need to consider when recombining components of a solution?

A

The order in which subroutines are executed, and how they interact with each other, based on their role in solving the problem.

31
Q

What is a decision?

A

A decision is a result reached after consideration

32
Q

When are decisions made?

A

A decision is made whenever you have to choice to make.

33
Q

What is the shape used to indicate a decision in a flow chart?

A

A diamond

34
Q

How do you make effective decisions?

A

By evaluating the importance of different factors and selecting options which satisfy the needs of the task the most appropriately.

35
Q

What is the procedural interface ?

A

You don’t need to know the ins and outs of a procedure, just the name etc