2.1 Flashcards

1
Q

What is abstraction?

A

Picking out important bits of information/details from the problem, ignoring the specific details that don’t matter

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

What is algorithmic thinking?

A

Logical thinking and thinking methodically

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

What is decomposition?

A

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

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

How do you write pseudocode? What are some ways you should write it

A
Write what you have to do in words but simply just important details. 
Variable = input"..."
If...then
   Else
Print
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does a oval mean in flow diagrams?

A

Start/stop

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

What does a parallelogram mean in a flow chart?

A

Input/output

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

What does a rectangle stand for in flow diagrams?

A

Processes -general instructions, processes and calculations

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

What does a diamond mean in a flow diagram?

A

Decision -yes or no

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

What does an arrow show in a flow diagram?

A

Show the direction you should follow

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

What’s an algorithm?

A

A precise sequence of instructions.

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

What’s computational thinking?

A

Computational thinking allows us to take a complex problem, understand what the problem is and develop solutions.

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

What’s linear search?

A
  • Look at the first item in the list
  • if this is the item you’re looking for stop
  • if not carry on to the next item in the list
  • repeat the 2 steps before until you find the item you were looking for or you’ve checked every item
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s binary search?

A
  • find the middle item in the ORDERED list
  • if this is the item you’re looking for then stop the search
  • if not then if your item is lower than the middle item you get rid of the second half of the list if it comes after the middle item you get rid of the first half of the list
  • you’re left with a list half the size then repeat the 3 steps before and keep going until you find what you’re looking for
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What’s the pros and cons of linear search?

A

Pros
-fairly simple to code
-the data does need to be in a set order
Cons
-slow to process large lists-worst case scenario is searching through the whole list
-not efficient, only works well with small lists

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

What’s the pros and cons of binary search?

A
Pros
-more efficient 
-more suitable for larger lists
Cons
-list has to be ordered 
-more complicated to code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What’s a bubble sorting algorithms?

A
  • look at the first two items in the list
  • if they’re in the right order leave them if not swap them
  • move on to the next pair the third and second and repeat the process
  • repeat that process until you get to the end of the list the last item will now be correct and so it’s not included in the next pass through
  • repeat going through the list until there are no swaps in a pass
17
Q

What are the pros and cons of bubble sort?

A
Pros
-simple to write the code for
-doesn't use very much memory
Cons
-inefficient, slow
-can't cope with really large lists
18
Q

What’s merge sort?

A
  • split the list in half again and again until each item is individual
  • merge these individual items with one other sub list each time you merge these sub lists you order them
  • repeat merging the sub lists until you’ve merged all of them together
19
Q

What are the pros and cons of merge sort?

A

Pros
-more efficient and quicker than bubble and insertion for large lists
-consistent running no matter how ordered the original items are
Cons
-slower for small lists
-it uses more memory than any of the other sorting algorithms

20
Q

What’s insertion sort?

A
  • look at the second item in the list
  • compare all the items before it and insert the item into the right place
  • repeat step 2 until you get to the last item in the list and it has been inserted into the correct place
21
Q

What are the pros and cons of insertion sort?

A

Pros
-easy to code, intuitive way of thinking about it
-copes very well with small lists, doesn’t require much additional memory
Cons
-doesn’t cope very well with large lists
-best case scenario requires n-1 comparisons
-worst case scenario requires n(n-1)/2 comparisons

22
Q

What’re two advantages of problem decomposition?

A
  • spend less time overall because of having a plan breaking down the bigger problem
  • create functions that could be reused in a different problem
  • different people can work on different aspects at the same time