Algorithms Flashcards

1
Q

the most fundamental types of algorithm are?

A
Recursive algorithms, 
Dynamic programming algorithm, 
Backtracking algorithm, 
Divide and conquer algorithm, 
Greedy algorithm, 
Brute Force algorithm,
Randomised algorithm
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

common algorithms

what is bubble sort algorithm?

A

sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

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

common algorithms

what is selection sort algorithm?

A

The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.

The subarray which is already sorted.

Remaining subarray which is unsorted.

In every iteration of selection sort, the minimum element (considering ascending order) from the unsorted subarray is picked and moved to the sorted subarray.

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

common algorithms

what is a binary sort algorithm?

A

Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly check until the value is found or the interval is empty.

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