in Algorithms retagged by
6,538 views
6 votes
6 votes

Selection sort algorithm design technique is an example of

  1. Greedy method
  2. Divide-and-conquer
  3. Dynamic Programming
  4. Backtracking
in Algorithms retagged by
6.5k views

4 Comments

greedy....coz it always find small among the large to sort
1
1
edited by

 Brute Force

.

1
1
I think all 4 options were incorrect
1
1

3 Answers

6 votes
6 votes

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

1 comment

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 ?
0
0
3 votes
3 votes
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

4 Comments

yes @shivani in ur link also told " the list is divided into two parts"
0
0
@ srestha after dividing ..how about conquering
0
0
like selection sort does , is it not?
0
0
3 votes
3 votes

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

3 Comments

Shivani, Yeah its bruitforce, but if you look at the core its greedy. Smilarly Insertion is divide and conquer.
1
1
You have given it a proof definitely you are right .
0
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.
0
0
Answer:

Related questions