T6 - Computational Thinking/ Searching/ sorting algorithms Flashcards

1
Q

Algorithms

A

set of instructions for solving a problem or completing a task

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

Abstraction

A

involves 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
3
Q

Algorithmic thinking

A

– an approach to solving problems by the use of algorithms (sequences of steps that lead to a solution)

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

Structure diagram

A

– a hierarchical diagram that shows how a problem is broken down into sub-sections/sub-tasks

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

Decomposition

A
  • involves breaking down a large problem into smaller sub-problems
    Then the sub-problems 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
6
Q

Advantages of decomposition

A
  • easier to solve
    -reusable
    -saving development time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A structure diagram

A

is used to show how a problem is broken down

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

Linear search:

A

requires checking through each item in the list, one by one
very slow
Don’t have to be sorted

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

Binary search:

A

List must be sorted
Examine the middle one first
the size of the list is halved each time an item is examined

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

The data sets could be sorted as follows:

A

Count order (which will be the same as the rank order)
Alphabetical order
Reverse alphabetical or count order

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

The bubble sort:

A

Start with the leftmost item
Compare this item with the one next to it
If the one next to it is less, swap the items
Repeat for all the other items
At the end of one pass through the list, the largest item is at the end of the list
Repeat the process until the items are sorted

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

Bubble sort - saving data:

A

When data is swapped, it is saved to a temporary variable
Then it is copied from the variable

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

Insertion sort:

A

sorts one data item at a time
One item is taken from the list, and placed in the correct position
This is repeated until there are no more unsorted items
Faster than bubble sort

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

Merging two lists:

A

Read item from list A; Read item from list B
Write smaller to output list.
Read next item from the list that held the smaller value
Repeat until all items written to output list

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

Merge sort pros:

A

More efficient than bubble sort and insertion sort

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

Merge sort

A

Divide the unsorted list in two
Continue to divide these lists into two until there is just one item in each list
Now merge each list back until there is only one
list remaining – which will be the fully sorted list