Searching and Sorting unit 1 Flashcards

(10 cards)

1
Q

What are standard algorithms for searching data?

A

Linear search and binary search.

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

What are standard algorithms for sorting data?

A

Bubble sort and merge sort.

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

How does a linear search work?

A

It checks each item one by one until the target value is found or the end is reached.

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

How does a binary search work?

A

It repeatedly splits a sorted list in half to find the target value.

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

How does bubble sort work?

A

It repeatedly compares and swaps adjacent items until the list is sorted.

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

How does merge sort work?

A

It divides the list into smaller parts, sorts them, and merges them back together.

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

When is a simple algorithm like linear search acceptable?

A

When the data set is small and efficiency is not a concern.

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

Why is the choice of algorithm important?

A

Because different algorithms perform better or worse depending on the size and type of data.

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

What influences the choice of algorithm?

A

The data structure, the size of the data, and how the data needs to be processed.

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

How can you evaluate if an algorithm is suitable?

A

By using logical reasoning and test data to check if it meets the requirements efficiently.

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