S1 Algorithms Flashcards

1
Q

What is an algorithm?

A

An algorithm is a sequence of steps that can be followed to complete a task.

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

What is the difference between an algorithm and a computer program?

A

An algorithm is a sequence of steps to solve a problem, while a computer program is an implementation of an algorithm.

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

What is decomposition?

A

Decomposition means breaking a problem into sub-problems, each with an identifiable task, which can be further subdivided if needed.

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

What is abstraction?

A

Abstraction is the process of removing unnecessary detail from a problem, focusing on the essential aspects.

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

How do you represent algorithms?

A

Algorithms can be represented using pseudo-code, program code, and flowcharts, and should be solved using a systematic approach.

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

How can you explain simple algorithms in terms of their components?

A

Simple algorithms can be explained by identifying their inputs, processing steps, and outputs.

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

How can you determine the purpose of simple algorithms?

A

Use trace tables and visual inspection to determine how simple algorithms work and what their purpose is.

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

Can more than one algorithm solve the same problem?

A

Yes, more than one algorithm can be used to solve the same problem, and some algorithms may be more efficient than others.

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

How do you compare the efficiency of algorithms?

A

Efficiency is compared by explaining how some algorithms are faster or more efficient in terms of time, but formal comparisons are not required.

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

How does the linear search algorithm work?

A

The linear search algorithm checks each element in a list sequentially until the target element is found or the end of the list is reached.

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

How does the binary search algorithm work?

A

The binary search algorithm repeatedly divides a sorted list in half, comparing the middle element to the target, narrowing down the search space.

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

Compare linear and binary search algorithms.

A

Linear search checks each element one by one, while binary search halves the search space with each step. Binary search is faster but requires a sorted list.

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

How does the merge sort algorithm work?

A

Merge sort divides a list into smaller sub-lists, sorts them, and then merges them back together in order.

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

How does the bubble sort algorithm work?

A

Bubble sort repeatedly compares adjacent elements in a list and swaps them if they are in the wrong order, bubbling the largest element to the end.

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

Compare merge sort and bubble sort algorithms.

A

Merge sort is more efficient, especially for large lists, but bubble sort is simpler. Merge sort divides and conquers, while bubble sort compares adjacent elements.

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

What does a start/ end flowchart symbol look like?

A
17
Q

What does a input/output flowchart symbol look like?

A
18
Q

What does a process flowchart symbol look like?

A
19
Q

What does a decision flowchart symbol look like?

A