Searching and Sorting Algorithms Flashcards

1
Q

What is an algorithm?

A

An algorithm is a series of steps that leads to a solution/desired output

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

What are the characteristics of an algorithm?

A

The Characteristics of an algorithm are:
Output - The values produced as a result
Clarity - The clarity of the code and if the computer is able to understand it
Efficiency - If the code is efficient and works well. The code must be basic.
Input - Values entered by the coder/user that helps up get to our desired output
Finiteness - If the code stops after finding the desired output.

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

How many types of searching techniques are there and what are they?

A

There are two types of searching techniques:

Linear Search and Binary Search

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

What is another name of linear search?

A

Another name of linear search is sequential search

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

What is linear search?

A

Linear search is a simple algorithm. For linear search, we need a set of data and in that set of data a value to be found. This algorithm will search through each element of the data and will give you the value to be found as an output. The search stops after the desired output is found.

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

What are the advantages of linear search?

A

The advantages of linear search are that we can find our desired value in a set of data. Linear search is simple and basic,

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

What are the disadvantages of linear search?

A

The disadvantage of linear search is that in a set with a lot of data, it is hard to find the desired output. In a big set if the linear search is used it would consume a lot of time.

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

What is sorting?

A

Sorting is the process in which elements of the data are sorted into ascending/descending order or an order decided by the user.

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

What are the two types of sorting? Explain both of them.

A

The two types of sorting are:
Internal Sorting - In this sorting the primary memory is used to store the data
External sorting - In this sorting, there is usually a large amount of data. Because of this, secondary memory is used.

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

What is bubble sort? Explain

A

Bubble sort is a sorting algorithm in which two neighbouring elements are compared and are sorted into ascending/descending order. All elements of the set are sorted and once the set is in an ascending/descending order the new set is displayed as an output.

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

What are the steps of bubble sort called?

A

The steps of bubble sort are called passes.

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