Algorithms Flashcards

(9 cards)

1
Q

What is the name of the process that breaks down a large problem into a smaller problem that can be solved separately?

A

Decompression.

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

What is an algorithm?

A

A step by step set of instructions to solve a problem.

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

T or F? Some algorithms can be only written by using flow diagrams.

A

False. Any algorithm can be written in plain English/Pseudo-code/Flow diagrams.

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

What is a binary search?

A

It is a search which finds a specific number.

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

How does binary search work?

A

The array is sorted in ascending order and then the middle value is picked out. If the value is less than the specific number then only the right side of the array is taken. If the number is bigger, then the left side is take and this procedure is repeated until the specific number is located.

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

What is a bubble sort?

A

Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.

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

How does a bubble sort work?

A

It goes through each pair of the array and then it puts them in size order.

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

What is merge sort?

A

It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves.

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

How does the merge sort work?

A

It keeps on splitting the array into pairs until they are all single digits. Then it compares the nearest 2 digits and puts it in ascending order. The step is repeated until all the pairs are sorted and put in the right order.

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