2.6k views

Selection sort algorithm design technique is an example of

1. Greedy method
2. Divide-and-conquer
3. Dynamic Programming
4. Backtracking
| 2.6k views
+1
I think its option A Greedy method as we choose minimum of all available elements
0

My confusion is between option A ,C

0
DYNAMIC CANT BE THE ANS ..COZ IT DO NOT DEPEND UP ON ITS PREVIOUS SORTED ITEMS....THINK THERE IS NO BUTTOM UP EVALUATION
0
So what is ur answer ASU
+1
greedy....coz it always find small among the large to sort
+1

Brute Force

.

+1
I think all 4 options were incorrect

Correct Answer would be A) Greedy Algorithm

Because, In the first iteration we put a pointer in the start of the array. Then next we start searching index of minimum element index in the rest of the array. Then replace the starting pointer value with minimum index value. (Considering the we are sorting in ascending order). Then repeat this process for each element.

by Boss (35.6k points)
0
sir, but greedy approach is used to solve optimization problems like maximize the profit , minimize the delay etc. so, to sort the numbers is a optimization problem ?
Selection sort used in divide and conquer technique

Here smallest element replaces 1st element of the array , 2nd smallest element replaces 2nd element and like that all element sorted
by Veteran (117k points)
+1
@srestha in selection sort we find min of all elements and it is placed at first right

then how it would be divide and conquer
0
@shivani selection sort also done the same, rt? break up list into two instance one instance has 1 element and other has (n-1) elements
0
0
yes @shivani in ur link also told " the list is divided into two parts"
0
@ srestha after dividing ..how about conquering
0
like selection sort does , is it not?

Selection Sort is Brute force Approach

http://faculty.simpson.edu/lydia.sinapova/www/cmsc250/LN250_Weiss/L28-Design.htm#brute

As we move through all the elements of array so greedy is within available elements we select min between 2 elements but we further move to all elements so i think it wont be greedy

by Boss (13.8k points)
+1
Shivani, Yeah its bruitforce, but if you look at the core its greedy. Smilarly Insertion is divide and conquer.
0
You have given it a proof definitely you are right .
0
The link you provided categorize solution of Knapsack Problem as Brute-Force approach. Whereas, Fractional Knapsack Problem is solved using Greedy Approach and 0/1 Knapsack Problem using Dynamic Programming.