9.1 Python and Searching & Sorting Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Algorithm

A

Step by step instructions to solve a problem

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

Searching

A

Finding a specific value / item within a list of data

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

Sorting

A

Arranging a set of data in a certain order

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

Linear Search

A

Searching through a set of data by looking at each item one by one.

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

Binary Search

A

A searching algorithm which only works if data is sorted in order. It works by repeatedly ignoring half of the data until it homes in on the value it’s looking for.

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

Bubble Sort

A

A sorting algorithm that goes through a list of data, swapping values where necessary, until each value is in order

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

Insertion Sort

A

A sorting algorithm that creates two lists, and ordered and unordered one. It then inserts the unordered list into the order list one item at a time until the unordered list is empty.

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

Merge Sort

A

A sorting algorithm that splits an unordered list into single items then sorts them into groups of two items. It repeats sorting two lists together until there is a single sorted list.

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

Computational Thinking

A

Using logical problem solving skills to solve problems

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

Which is the simplest searching algorithm?

A

Linear Search

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

What does the list have to be in order for binary search to work?

A

In order

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

Which searching algorithm starts in the middle of the list?

A

Binary Search

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

Where does a linear search start?

A

At the start

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

When performing a linear search, what would be the worst case scenario for a list that has 100 items in it?

A

100

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

Which sorting algorithm starts by comparing the first two items?

A

Bubble Sort

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

Which sorting algorithm starts by splitting the list into individual lists?

A

Merge sort

17
Q

Which sorting algorithm starts by creating a sorted and unsorted list?

A

Insertion Sort

18
Q

What command word is used in Python to display text on the screen?

A

Print

19
Q

In Python, what number does a list start at?

A

0

20
Q

As well as IF, what else can you have?

A

if, elif, else

21
Q

You always need a colon at the end of an IF statement.

A

True

22
Q

How does Binary Search work?

A

List must be in order
1. Find middle value
2. Is num = to target
-yes: target found
3. -No: Is your target greater than the middle num?
-Yes: discard left
-No: discard right

23
Q

How does Linear Search Work?

A
  1. Check number
  2. Is it = to target
    -yes: target found
  3. -No: Are there any nums left
    -Yes: Check nums again
    -No: Target not in list