[Unit 2.1] Computational Thinking Flashcards

Algorithms and Programming

1
Q

define thinking concurrently

A

how problems can be run at the same time to be more efficient

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

how does concurrent processing work

A

process happens at same time. one starts before another finishes.

each process is given a slice of processor time
different processes can be executed in different cores

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

how does multitasking work in terms of concurrent processing

A

on a single core CPU:
-process is given slice of CPU time then paused
-next process is give slice of time and paused
-so on

on a multicore CPU:
-programs split between cores
-then same as single core CPU

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

what are the advantages of concurrency

A

more efficient use of processor time.

long running tasks do not delay shorter ones

tasks with preconditions can wait

user interact with other tasks

multiple users use same system at same time

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

what are the disadvantages of concurrency

A

not always faster than serial processing

makes programming harder

OS needs complex scheduling algorithms

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

whats the difference between parallel and concurrent processing

A

parallel - one core is running one task and another core running a different task

concurrent - cores swap processes between cores giving each process a slice of CPU time

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

what is multithreading

A

processes of program are divided into threads which can be worked on at the same time

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

define logic

A

principles used to reason about data in precise and structured manner

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

define thinking logically

A

carefully planning an algorithm to solve problems.

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

define pseudocode

A

write algorithms using code-like statements

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

define flow-charts

A

visually represent the steps that make up an algorithm

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

define decomposition

A

breaking down a complex problem down into smaller more manageable sub-problems

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

define top-down design

A

breaking a problem down into major tasks, each task is broken into subtasks and so on.

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

what is a hierarchy chart

A

used for representing structure of a program showing how modules relate to each other.

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

what are the advantages of decomposition

A

-splits problem into smaller easier problems

-makes problem more solvable

-leads to development of subroutines

-leads to modularity

-allows reusability

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

define thinking ahead

A

planning code to ensure efficient outcome and reusing code where possible.

17
Q

what 4 things are involved with thinking ahead

A

I/O

pre conditions

reusable components

caching/pre-fetching

18
Q

what are preconditions

A

conditions that must always be true before section of code executes

19
Q

what are the advantages of preconditions

A

-ensures programmer knows what to check before calling code

-if none you can avoid unnecessary coding

-documentation of I/O & pre-conditions helps make code reusable

20
Q

what are reusable components

A

modules/sections of program that are designed to be used in multiple programs without modification.

21
Q

what are the advantages of reusable components

A

reduce code complexity

improve readability

save time

save money

22
Q

what is caching in terms of thinking ahead

A

temporary storage of program instructions that have been used once and may be needed again shortly

23
Q

give an example of caching in regular programming

A

putting a file into an array.

24
Q

what are the disadvantages of caching

A

if original data is changed while being cached there will be inconsistencies and errors

25
Q

What is computational thinking

A

The ability to think logically about a problem and apply techniques for solving it. Come up with more efficient solution

26
Q

What is abstraction

A

Simplifying a problem by removing unnecessary details so we can focus on important parts

27
Q

What are the advantages of using abstraction

A

simplifies design of software

simplifies coding of software

saves memory & other system resources.