3.1 - algorithm/efficiency Flashcards

flowcharts, data types, tracetable

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

define decomposition

A

the process of breaking down a complex problem to smaller sub-problems and solving them individually

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

define abstraction

A

Removing unnecessary detail from a problem

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

define an algorithm

A

a sequence of steps which are carried out in order to solve a problem

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

what are the benefits of decomposition and abstraction?

A

easier to solve a problem

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

what data type is able to store the following data?

100, 1, 3

A

Integer

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

give an example of decomposition in real life

A

process of making a car

  • making the engine
  • making the wheels
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

give an example of abstraction

A

not focusing on the additional paths on an underground map

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

what is generalisation

A

the process of creating one solution to a problem, which can then solve many different problems

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

define algorithmic thinking

A

the ability to be able to solve problems by creating algorithms

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

what is functional decomposition

A

splitting up a problem into smaller problems, each would be programmed using subroutines

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

what is selection

A

the ability to run different parts of the algorithm based on a condition

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

what are parameters

A

limits of the inputs in an algorithm

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

what is a dry run of a pseudocode?

A

when a code is run by programmers instead of computers

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

what are the advantages of dry runs

A

being able to see where logical errors and bugs are

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

what is the purpose of a trace table?

A

To show the value of each variable while an algorithm is dry run

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

Is a computer program an algorithm?

A

It is an implemention of an algorithm, not an algorithm itself

17
Q

Define pseudo code?

A

A text based way of setting out an algorithm

18
Q

What is casting?

A

The process of declaring the data type to be used (when assigning to a variable)

Ie. Phone

19
Q

Give examples of iteration in a code?

A
  • WHILE
  • FOR
  • DO

(Running the same code repeatedly)

20
Q

Give two ways to measure the efficiency of an algorithm?

A
  • measure the time taken

- measure the space used

21
Q

If you measure the time efficiency, what do you measure?

- TAKE A PAUSE, THINK ABOUT IT

A

The number of steps in the algorithm (not time taken to complete)

🐾🐾🐾🐾🐾

22
Q

Disadvantage of writing efficient algorithms?

A
  • efficient algorithms can be more complicated + hard to code than non-efficient ones
  • may need other requirements (ie. binary search only works on ordered lists)
23
Q

What is a computer program an implementation of?

A

Implementation of an algorithm

ALGORITHM IS NOT A COMPUTER PROGRAM

24
Q

what does it mean if something is language independent?

A

means an algorithm can be written in any programming language