Algorithms Flashcards

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

What is abstraction

A

Identifying the details in a problem that are important to solving the problem and focusing on them while ignoring irrelevant detaisl

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

What is decomposition

A

Breaking down a problem into smaller problems and solving each one individually

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

Define computational thinking

A

Tackling a problem through decomposition, abstraction and algorithmic thinking

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

Define algorithmic thinking

A

Logical way of getting from a problem to a solution by identifying the steps

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

Advantages of pseudocode

A

quick to write
easily converted into a programming lanuage

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

Briefly describe the steps for linear search

A

Look at the first item in the ordered list
If this is the item you are looking for then stop the search
If not look at the next item in the list
Repeat step 2-3 until you find the item or every item has been checked

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

Advantages/Disadvantages of linear search

A

simple easy can be done in an unordered list
Not as effective as other search algorithms - more suited for small data sets

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

Briefly describe the steps in binary search

A

Find the middle item in an ordered list
If this is what you are looking for then stop
If not compare the item you are looking for with the middle item
If it comes before the middle get rid of the second half vice versa
Repeat

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

Pros/Cons binary search

A

More efficient than linear search as it i sable to find a value in an array much faster
More suited for larger data sets

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

Briefly describe the steps for bubble sort

A

Look at first item two item in the list
If they are in the right order leave them, if they are in the wrong order swap them
Repeat step 2 with next to items
Repeat 3 until you reach the end of the list
Repeat step 1-4 until there are no swaps in a pas

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

Pros/Cons bubble sort

A

Very simple can be easily implemented
Inefficient to sort large numbers of data
Doesn’t use as much memory

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

Briefly describe the steps for insertion sort

A

Look at the second item in the list
Compare it to all the items before it and insert them into the correct place
Repeat tep 2 for each subsequenet item in the list until all of the item in the list has been sorted

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

Pros/Cons insertion sort

A

well-suited for small data ets and new data can be quicklu added to an already sorted data set
Good for small lists
Very quick at checking if the list is already ordered
Not well suited to large data set because significant amount of comparisons needed

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

Briefly describe the steps for merge sort

A

Split the lit in half
Repeat step 1 until each sub list contains one item
Merge pairs of sublist o that each sub list has twice as many items

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

Pros/Cons merge sort

A

More efficient and quicker than bubble sort
Consistent running time
Slower than other algorithms for small lists
Even if the list is already sorted still does the merge sort
Uses more memory than other algorithms

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