Elements of Computational Thinking

0.0(0)
studied byStudied by 3 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/55

flashcard set

Earn XP

Description and Tags

Made from P.M.T. and Ada comp. sci. notes

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

56 Terms

1
New cards

What is the shape used for decisions in a flowchart?

A (decision) diamond

2
New cards

In a flow chart how many options can you pick from a decision?

2 different options - yes or no/ true or false

3
New cards

How does the result of a decision affect the flow of a program?

The program will follow a different route depending on the result of a decision

4
New cards

What is abstraction?

  • The process of separating ideas from reality.

  • It is a representation of reality in which unnecessary detail is removed so that only the key features remain.

5
New cards

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

Large, complex problems

6
New cards

How does abstraction allow non-experts to make use of a system?

Hides complex and irrelevant information in abstract models.

7
New cards

What are the advantages of abstraction?

  • Simplifies the problem

  • Less computation / data.

  • Easier to see how the solution to one problem can also be the solution to another.

8
New cards

What are the advantages of using abstraction in software development?

  • Simplifies the problem, making it easier for programmers to focus on core elements.

  • This can reduces the time spent on a project and prevent a program from getting unnecessarily large

9
New cards

What is a disadvantage of abstraction?

Models will not be as accurate as reality

10
New cards

What are two examples of layers of abstraction in computer science?

  • Networking (TCP/IP layer)

  • Programming languages

11
New cards

What are two advantages of using abstraction in programming languages?

  • Easier to remember syntax in high-level languages as it is closer to natural language

  • Coding becomes accessible to beginners

12
New cards

How does object-oriented programming use abstraction?

  • Objects are an abstraction for real-world entities.

  • Attributes are an abstraction for the characteristics of an object.

  • Methods are an abstraction for the actions a real-world object is able to perform.

13
New cards

What is the difference between abstraction and reality?

Abstraction is a simplified representation of reality, in which certain unnecessary details are removed

14
New cards

What is problem reduction?

The process of generalising or reducing a problem to one that has already been solved.

15
New cards

What is automation?

The process of taking the model and implementing a solution. This is achieved by:

  • Implementing the data structures to store the data

  • Implementing the algorithms to process the data

16
New cards

What is the first stage of thinking procedurally?

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

17
New cards

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

Identifying components of a solution

18
New cards

What are the advantages of thinking procedurally?

  • Problems are easier to solve.

  • Debugging is easier.

19
New cards

What is a disadvantage of thinking procedurally?

May not be entirely possible with an event driven rather than procedural approach to programming.

20
New cards

What is decomposition?

The process of breaking a problem down into smaller subproblems that can be solved individually and more easily

21
New cards

What is another name given to top-down design?

Stepwise refinement

22
New cards

What is the purpose of top-down design?

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

23
New cards

What are the benefits of using top-down design?

  • Problems can be solved and modules developed by different people.

  • Tasks can be tested separately. Modules are self-contained

24
New cards

What types of problems is top-down used for?

Large, complex problems

25
New cards

How are the lowest level subproblems in top-down design implemented in code?

As self-contained modules or subroutines

26
New cards

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

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

27
New cards

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

See whether it is possible to use an existing subroutine or module to solve the problem.

28
New cards

What are the advantages of utilising reusable components?

  • They have often already been tested so are likely more reliable than newly-coded components

  • As such less time is spent debugging and testing, which saves time, money and resources.

29
New cards

What is thinking ahead?

  • The process of identifying the preconditions of a system: inputs, outputs, and reusable components.

  • This means identifying what data is required before it is needed (caching) and identifying reusable program components.

30
New cards

What are the advantages of thinking ahead?

Caching can speed up a process

31
New cards

What are the disadvantages of thinking ahead?

  • Caching can be complicated to implement.

  • Caching requires the correct data to be fetched for the next instruction.

32
New cards

What is an input?

Any data that is required to solve a problem, usually entered into the system by the user

33
New cards

What is an output?

The results that are passed back once the inputs have been processed and the problem solved

34
New cards

What four considerations do programmers need to make about inputs and outputs when thinking ahead?

  • Method of input/output (device used)

  • Data structures used

  • Data types used

  • Order of data

35
New cards

What are preconditions?

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

36
New cards

Where can preconditions be defined?

Within the code or within documentation.

37
New cards

What are four advantages of including preconditions within the documentation accompanying a subroutine?

  • 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

38
New cards

Define caching

The process of storing instructions or values in cache memory after they have been used, as they may be used again

39
New cards

What is an advantage of caching?

Saves time as you don’t need to wait for instructions to be retrieved from secondary storage again

40
New cards

How is caching used in storing web pages?

Web pages that a user frequently accesses are cached, so the next time one of these pages is accessed, content can be loaded without any delay

41
New cards

What are the advantages of caching web pages?

  • Content can be loaded without delay as less time is spent waiting

  • Images and text do not have to be downloaded again multiple times

  • Frees bandwidth for other tasks on a network

42
New cards

What limits the effectiveness of caching?

  • Accuracy of the algorithms used

  • Effectiveness of algorithm in managing the cache

  • Size of the cache

43
New cards

What is prefetching?

When algorithms predict which instructions are likely to soon be fetched and are loaded and stored in cache

44
New cards

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

Prefetching

45
New cards

What is an advantage of prefetching?

Less time is spent waiting for instructions to be fetched

46
New cards

What are two advantages of using reusable program components?

  • More reliable than new components, as they have already been tested.

  • Since developing from scratch is not required, this saves time, money and resources.

47
New cards

What are three examples of reusable program components?

  • Abstract data structures eg. queues and stacks

  • Classes

  • Subroutines

48
New cards

What is thinking logically?

  • Identifying individual steps and decision points of an algorithm.

  • This can involve:

    • Identifying the points at which a selection or iteration is needed.

    • Determining the conditions of the decision.

    • Determining the next steps depending on the outcome of the decision.

49
New cards

What are the advantages of thinking logically?

  • Makes writing an algorithm easier.

  • The complexity of an algorithm can be determined.

  • Algorithms can be simplified, or better solutions found more easily.

  • Identifies branches for testing.

50
New cards

What is concurrent processing?

When two or more tasks are in progress at the same time (but not necessarily being executed) simultaneously.

51
New cards

What is thinking concurrently?

Identifying parts of the problem that can be executed at the same time.

52
New cards

What are the benefits of concurrent processing?

  • More efficient use of processor time, as the time that would be wasted by the processor waiting on a user (input) or another process is reduced.

  • As such more tasks can be completed during a given time

  • More efficient processing of interrelated tasks

53
New cards

What are the drawbacks of concurrent processing?

  • There is an overhead in coordinating and switching between processes, which reduces program throughput.

  • May be difficult to program.

  • Can result in deadlock - when multiple tasks stop and wait on each other indefinitely

  • Not all tasks are suited to being broken up and performed concurrently.

54
New cards

What is parallel processing?

  • When multiple tasks are executed simultaneously

  • They must be physically executing at the same time, for example on different cores of a multi-core processor.

  • Parallel processing is a specialised form of concurrency

55
New cards

How is parallel processing physically achieved?

  • By using multi-core processors and/or multi-processor infrastructure

  • This means a single core CPU can not perform parallel processing

56
New cards

What is the difference between concurrent and parallel processing?

  • Concurrency is about dealing with lots of things at once. This means multiple tasks are in progress, but not necessarily executing, at the same time

  • Parallelism is about doing lots of things at once. This means (physically) executing multiple tasks at the same time.

  • As such a single core CPU could perform concurrent processing (by spliting up its processor time between different tasks), but not parallel processing (as it cannot physically execute multiple taks at the same time with a single core)