Week 4 Chapter 6 Flashcards

1
Q

Q: Who is the mathematician after whom the term “algorithm” is derived?

A

A: The term “algorithm” is derived from Mohammed ibn-Musa al-Khwarizmi, a Persian mathematician who lived between 780 and 850 in Baghdad.

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

Q: What is another name for algorithms?

A

A: Algorithms are also known as pseudo-codes.

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

Q: What makes algorithms language independent?

A

A: Algorithms are language independent because they can be implemented in any programming language.

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

Q: What are the key characteristics of algorithms?

A

A: The key characteristics of algorithms are:

Language independent
Unambiguous
A set of predefined instructions
Focus on speed and efficiency
Initial step before software development.

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

Q: What is the main purpose of search algorithms?

A

A: The main purpose of search algorithms is to search in arrays for an item.

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

Q: Name two search algorithms.

A

A: Two search algorithms are:

Binary search
Linear search

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

Q: What is the purpose of sort algorithms?

A

A: Sort algorithms are used to arrange elements in a specified order.

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

Q: Name four sort algorithms.

A

A: Four sort algorithms are:

Bubble sort
Merge sort
Insertion sort
Selection sort

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

Q: How does the bubble sort algorithm work?

A

A: The bubble sort algorithm works by swapping elements until the array is sorted.

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

Q: How does the merge sort algorithm work?

A

A: The merge sort algorithm works on the divide and conquer approach.

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

Q: How does the insertion sort algorithm work?

A

A: The insertion sort algorithm works by comparing and interchanging elements to sort them.

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

Q: How does the selection sort algorithm work?

A

A: The selection sort algorithm works by making two sub-arrays and using the smallest element to sort the array.

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