Problem solving/ Algorithm Flashcards

1
Q

What is Problem solving?

A

Creating a set of instructions that when executed accepts input and produces meaningful information.

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

What is an Algorithm?

A

A sequence if instructions which solves a problem

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

What are the steps in problem solving?

A
  1. Define the problem
  2. Propose and evaluate the solutions
  3. Determine the best solution
  4. Develop the algorithm
  5. Represent the algorithm using pseudo code or flowchart
  6. Test the solutions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Divide and Conquer Approach?

A

Repeatedly split a large problem into a smaller sub problem until a complete solution is identified.

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

What is a variable?

A

Area of storage whose value changes during processing. Eg. Price

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

What is a constant?

A

An area of storage whose value does not change during processing. Eg. Pi is always 3.14

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

What is an identifier?

A

A name given to a variable/constant by a programmer.

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

What are characteristics of a good algorithm?

A

•It must be precise
•It must be unambiguous
•It must be in a logical sequence
•It must have a finite number of steps or it must end.

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

What are data types?

A

It specifies what values a variable or constant can hold.

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

Integer

A

Whole numbers

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

Real

A

Any number that contains a decimal place.

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

String

A

Text or sequence of characters.

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

Cher

A

A single character found on a keyboard.

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

Bolean

A

True or False/ Yes or no

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

What are the types of Algorithms?

A

Pseudocodes and Flowcharts

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

What is a pseudocode?

A

Lists in words the steps to solve a problem in a structured way.

17
Q

What are Flowcharts?

A

A diagrammatic way to represent an algorithm.

18
Q

What are the Control structures?

A

•Sequential Statements
•Selection or Conditional statements
•Repetition/Loop/Iteration

19
Q

What is sequential statements?

A

Every line of the algorithm is carried out in the order it was written.

20
Q

What are Selection) Conditional statements

A

Not every line if the algorithm is carried out. It will be carried out based on a condition.

21
Q

What are Repetition/Iteration/Loop statements?

A

Some lines may be repeated until a condition is satisfied.

22
Q

When are IF THEN statements used?

A

When one option is given based on a condition.

23
Q

When are IF THEN ELSE statements used?

A

When two options are given based on a condition.

24
Q

What are the 2 types of loops?

A

•Definite/ Bounded Loop
•Indefinite/ Unbounded Loop

25
Q

What are Definite/ Bounded Loops?

A

Where you know how many times to repeat the loop.

26
Q

What are Indefinite/Unbounded Loops?

A

Where you do not know how many times to repeat the loop.

27
Q

When is the FOR loop used?

A

It is used only when the start value and end values are known.

28
Q

What is the form of the FOR Loop?

A

FOR <variable> = <start> TO <end> DO
{statement to be repeated}
End for
STOP</end></start></variable>