Algorithms and Programs Flashcards

1
Q

Algorithm

A

An algorithm is a set of mechanical and sequential steps that are followed in order to receive some form of input and process it to form an output. Two ways of representing an algorithm are Pseudocode and Flowchart.

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

Lossy compression

A

File is compressed to a smaller size but some information is lost during the process.

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

Lossless compression

A

Reduces the file size without losing any information.

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

Linear search

A

Linear search is the simplest searching algorithm; it starts at the first element in the list and checks every element until it finds the one it is looking for. The problem with this method is that it isn’t very efficient, especially with large data sets it can take a large amount of time.

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

Binary search

A

Binary search is a good way of searching lists that have been sorted. Binary search is a very powerful algorithm because of how fast it is, because with each comparison, the algorithm eliminates half of the data.

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

Bubble sort

A

The bubble sort algorithm works by passing through the data, comparing each value with the following one and swapping them if necessary. Several passes are made until the data is in order.

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

Insertion sort

A

The insertion sort algorithm uses two lists, one for sorted elements and one for unsorted elements. Comparisons are made and data is inserted in the right position in the sorted list. Other items are then moved along. This process is then repeated.

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