# 2.1 Algorithms Flashcards Preview

## AA - COMPUTING - Actual Spec > 2.1 Algorithms > Flashcards

Flashcards in 2.1 Algorithms Deck (15)
1
Q

Define linear search

A

A sequence that checks every item in a list 1 by 1 until it finds the desired item.

2
Q

Define binary search

A

A sequence that finds the desired item of a list according to the midpoints.

3
Q

What happens if the midpoint is greater than the desired item?

A

It scraps the midpoint and the data to its left and checks again.

4
Q

What happens if the midpoint is smaller than the desired item?

A

It scraps the midpoint and the data to its right.

5
Q

Define bubble sort

A

Bubble sort makes multiple passes through a list. It compares items and changes those that are out of order. Each pass through the list places the next largest value in its proper place.

6
Q

How are numbers sorted in bubble sort?

A

Compares 1st 2 items and swaps them if necessary.

7
Q

Define pass

A

A full cycle of swapping (doesn’t mean list is sorted).

8
Q

Define insertion sort

A

A more efficient version of bubble sort. Each pass would insert each number into its correct place.

9
Q

How are numbers sorted in insertion sort?

A

Compares 1st 2 items and inserts the necessary item into its complete correct position rather than swapping them. Has 2 lists, unsorted and sorted.

10
Q

Where is insertion sort very efficient?

A

A small data set or where data is mostly sorted.

E.g. a pack of cards.

11
Q

What is merge sort?

A

An efficient sequence that divides an unsorted list into sublists with 1 item each and merges the lists together until it has a complete sorted list.

12
Q

Define computational thinking

A

Use of computers to solve problems.

13
Q

Define abstraction

A

Representing “real world” problems in a computer using variables and symbols and removing unnecessary elements from the problem.

14
Q

Define decomposition

A

Breaking down a large problems into smaller sub-problems.

15
Q

Define algorithmic thinking

A

Identifying the steps involved in solving a problem.