1.1 Algorithms Flashcards

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

What are Algorithms?

A
  1. Algorithms are a sequence of instructions that perform a certain task.
  2. They are completely independent and can be implemented
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Pseudocode?

A

Programmable code written in standard english for easier understanding.

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

What is a Flowchart?

A

Flowcharts also represent data flow, but the shapes have different meanings.

The oval → Start/End

The Square → Process

The Rhombus → Decision

The Parallelogram → Inputs/Outputs

The Lined Rectangle → Subroutines

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

What is a Linear Search?

A
  1. A linear search checks each element until a match is found, or until the whole list has been checked.
  2. Uses Brute Force.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Binary Search?

A
  1. Binary search is done by dividing a list into two and eliminating the half not containing the targeted element.
  2. The list must also be ordered.
  3. Works by simplification.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is a Binary Search conducted?

A
  1. Find the Midpoint
  2. Eliminate Unneeded half
  3. Repeat Until found
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Bubble Sort?

A
  1. A bubble sort orders an unordered list
  2. It does so by making comparisons to adjacent elements and swapping them, largest value to the back
  3. Each comparison to the full data set is a pass
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Merge Sort?

A
  1. Divide and Conquer and Merge:
    1. The list is first divided into two, keeps splitting until there is one element left
    2. Sorts the list recursilvely
    3. Merge the lists from the single elements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When should Linear/Binary Search be used?

A
  1. Linear Search should be used in unordered lists, whilst binary searches require ordered lists.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly