2.1 - Algorithms Flashcards

(20 cards)

1
Q

What is abstraction in computational thinking?

A

Abstraction involves removing unnecessary details to focus on the essential aspects of a problem.

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

Provide an example of abstraction in computing.

A

Using symbols on a map to represent real-world objects like roads and buildings.

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

What is decomposition in computational thinking?

A

Decomposition is breaking down a complex problem into smaller, more manageable parts.

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

Why is decomposition useful in problem-solving?

A

It simplifies complex problems, making them easier to understand and solve.

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

What is algorithmic thinking?

A

Algorithmic thinking is the ability to develop a step-by-step solution to a problem or to identify the steps needed to solve it.

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

What are the three main principles of computational thinking?

A

Abstraction, Decomposition, and Algorithmic Thinking.

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

What is a structure diagram?

A

A visual representation that shows the breakdown of a system into its component parts.

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

What is pseudocode?

A

A method of writing algorithms using plain language that resembles programming code.

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

What is a flowchart?

A

A diagram that represents a process or algorithm, showing the steps as boxes connected by arrows.

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

What is the purpose of a trace table?

A

To track the values of variables during each step of an algorithm to identify errors.

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

What is a linear search?

A

A search algorithm that checks each element in a list sequentially until the desired element is found or the list ends.

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

What is a binary search?

A

A search algorithm that repeatedly divides a sorted list in half to locate a target value.

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

What is a bubble sort?

A

A sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.

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

What is an insertion sort?

A

A sorting algorithm that builds the final sorted list one item at a time by comparing and inserting elements into their correct position.

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

What is a merge sort?

A

A divide-and-conquer sorting algorithm that divides the list into halves, sorts them, and then merges the sorted halves.

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

What are the advantages of using a binary search over a linear search?

A

Binary search is more efficient for large, sorted lists, reducing the time complexity to O(log n) compared to O(n) for linear search.

17
Q

What is the time complexity of bubble sort in the worst case?

A

O(n^2), where n is the number of elements to sort.

18
Q

What is the key difference between merge sort and bubble sort?

A

Merge sort is more efficient with a time complexity of O(n log n) and uses a divide-and-conquer approach, while bubble sort is simpler but less efficient.

19
Q

What is the purpose of using pseudocode and flowcharts in algorithm design?

A

They help in planning and visualizing the algorithm before implementation, making it easier to understand and debug.

20
Q

What is the significance of identifying inputs, processes, and outputs in algorithm design?

A

It helps in clearly defining what the algorithm will receive, what it will do, and what it will produce, ensuring a complete understanding of the problem.