fundamentals of algorithms Flashcards

1
Q

define an algorithm

A

a sequence of precise instructions that, once performed, will complete a specific task

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

what are algorithms used in

A

solving problems in computing, but they’re also frequently used to describe sequences of instructions in the non-digital world

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

what are computer programs

A

algorithms written in a programming language

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

define decomposition

A

the process of breaking down a complex task into a sequence of simpler subtasks or subproblems

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

how does decomposition make a problem easier to solve

A

because each of the subproblems can be looked at and solved separately; sometimes referred to as ‘divide and conquer’

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

advantages of decomposition

A
  • error detection and debugging is made easier when you focus on smaller sections of code
  • makes solving larger problems easier to solve
  • some modules may be reusable in other
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

define abstraction

A

the act of removing complexity from a problem by hiding background details and removing unnecessary information

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

advantages of abstraction

A
  • it allows the developer to focus on the important parts of the problem to develop a solution
  • large problems are made simpler and easier to r
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what can a linear search be used on

A

both ordered and unordered lists

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

linear search method

A

the items in the list are examined in order (one by one) until it either finds the search item or reaches the end of the list

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

name the two searching algorithms

A

linear and binary searches

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

when is it suitable to use a linear search and why

A

it is more suitable for small lists of data, because the linear search is an inefficient algorithm

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

what determines an efficient searching algorithm

A

if in the worst-case scenario, it needs many comparisons in order to search a large list

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