Unit 1 - Fundamentals of algorithms Flashcards

1
Q

Define the term “algorithm”

A

An algorithm is a sequence of steps that can be followed to complete a task; for example, a computer program

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

Define the term “decomposition”

A

Decomposition is the breaking down of a problem into smaller sub-problems which can be broken down further until each small task is manageable

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

State the advantages of decomposition

A

Advantages of decomposition are:
* The problem becomes easier to solve when it consists of a number of small modules
* Some modules can be reused in other programs which saves development time

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

Define the term “abstraction”

A

Abstraction is the process of removing unnecessary detail from a problem so that you can focus on the essential components

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

Define the term “variable”

A

A variable is a location in memory where you can temporarily store a value such as a string

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

Define the terms “sequence”, “selection”, and “iteration”

A
  • Sequence - a series of steps which are completed one after the other
  • Selection - the ability to choose different paths through a program
  • Iteration - repeating a part of the program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is this flowchart symbol?

A

Start/End - this begins and ends all flowcharts - the shape is called a terminator

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

What is this flowchart symbol?

A

Arrow - this shows the relationship between the representative shapes

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

What is this flowchart symbol?

A

Input/Output - this either asks the user to input information or displays information

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

What is this flowchart symbol?

A

Process - maths operations and assignment of variables

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

What is this flowchart symbol?

A

Decision - changes the flow of the program based on a decision

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

What is this flowchart symbol?

A

Subroutine - calls a different function or procedure

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

What is an “integer”?

A

An integer is a whole number

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

What is a “real”?

Also known as a “float”

A

A real is a number with a decimal point

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

What is a “boolean”?

A

A boolean is something which can only be true or false

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

What is a “character”?

A

A character is a single alphabetic or numeric character”

(e.g. “a”, “K”, “4”, “@”, “%”, etc)

17
Q

What is a “string”?

A

A string is one or more characters enclosed in quote marks

(e.g. “I severly dislike having to study this”)

18
Q

What is “pseudocode” and why is it used?

A

Pseudocode is a structured English for describing algorithms, allowing programmers to focus on the logic of the program without being distracted by the exact syntax of the programming language

19
Q

What is meant by “linear search” and how does it work?

A

A linear search is a way of sorting a list by going through each item in sequence in the list and eliminating it until the desired item is found.

20
Q

State the advantages and disadvantages of linear search.

A

Linear search can work with any unsorted list but can take a long time if the list is very long

21
Q
A