Fundamentals Of Algorithms Flashcards

1
Q

What is an algorithm?

A

A series of instructions that describe how to solve a problem or perform a task

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

What is decomposition?
Advantages?

A

Decomposition is breaking a problem down into smaller ‘sub-problems’

Smaller problems are easier to solve than larger problems
Sub-problem can be kept separate making planning and working to timescale
Sub-problems are easier to distribute among a team

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

What is abstraction?

A

Hiding the layers of complexity within a system in order to focus on one specific layer of complexity

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

What is pseudocode?

A

A cross between English and generic-looking programming language. It does not have an exact language

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

What is a flowchart?

A

Defining an algorithm using shapes and arrows. Within each shape, an action is taking place or decision being made

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

What shapes are used for different commands?

A

Ellipse — Terminator
Diamond — IF Statement
Rhombus — Decision
Rectangle — Process

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

What is the efficiency of an algorithm?

A

Efficiency is a measure to compare 2 different algorithms that solve the same problem. More efficient is dictated by the number of time and space used.

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

What is a searching algorithm?
What are the 2 types of searching?

A

Searching is determining whether a piece of data exists within a data structure.
Linear search algorithm begins at 1 end of the data structure and checks each data item till the required item is found.
Binary search algorithm begins in the middle eliminating half of the data with each loop.

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

What is a sorting algorithm?
What are the two types?

A

Sorting algorithms put data in order whether in numerical, alphabetical, or chronological order.

Bubble///Merge Sorting

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

How do linear and binary search compare to each other?

A

Linear search can function on unsorted data whereas a binary search cannot
Linear search is more time consuming than a binary search

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

How to bubble and merge sort compare to each other?

A

Bubble sort is much more straightforward to program.
Merge sort requires lots more memory when it runs
Merge sort is much more efficient in terms of time

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