Problem Decomposition Flashcards

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

What is decomposition?

A

Breaking down a problem into smaller parts or sub-problems

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

How can parts of a problem be solved?

A

They can be solved by using discrete algorithms (ones which follow a simple input-process-output pattern)

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

What is an algorithm?

A

It is a set of instructions intended to solve a problem

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

What are features of a good algorithm?

A

Clear steps to produce the correct output for any steps of valid inputs
Should allow for invalid inputs
Must always terminate at some point
Should execute efficiently
Should be designed in a way that other people can understand it

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

What is a subroutine?

A

It is a block of code that is usually give a name

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

How are subroutines executed?

A

Subroutine are called and are executed form beginning to end. Then control is passed back to the line containing the subroutine call

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

What are parameters?

A

They are things which are passed into subroutines.

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

What is an argument?

A

It is the values specified for a parameter when a subroutine is called

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

What is the difference between subroutines and functions?

A

Functions are subroutines that return a value. Procedures are subroutines which don’t return a value

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

How are functions written in pseudocode?

A
Function doubleIt(number)
  Return 2 * number
End function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are used for structure diagrams/ hierarchy charts?

A

They are used to identify major tasks and break them down into subtasks

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

How are structure diagrams different from flow charts?

A

They don’t show data flow, instead they show chunks of functionality and code structure

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

How are hierarchy charts structured?

A

At the top is the whole program/project
Then is the tasks/abilities of the program (often these are source code files)
The bottom level is the functions/procedures (mostly following the input process output pattern)

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

What is a trace table?

A

It is used to check an algorithm at the design stage to see if it is going to work as planned

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

What are the columns and rows representing in a trace table?

A

Each column represents a variable or the output of the program
Each row represents each point in time or different stages of the algorithm that has been written

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