Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Implement Selection Sort #5327

Open
harshraj8843 opened this issue Jan 16, 2024 · 7 comments
Open

Implement Selection Sort #5327

harshraj8843 opened this issue Jan 16, 2024 · 7 comments
Labels
auto-track Good First Issue Tracker program

Comments

@harshraj8843
Copy link
Contributor

harshraj8843 commented Jan 16, 2024

Description

Write a program to implement selection sort

Selection sort is a sorting algorithm that selects the smallest element from an unsorted list in each iteration and places that element at the beginning of the unsorted list.

Pseudocode

procedure selection sort 
   list  : array of items
   n     : size of list

   for i = 1 to n - 1
   /* set current element as minimum*/
      min = i    
   
      /* check the element to be minimum */

      for j = i+1 to n 
         if list[j] < list[min] then
            min = j;
         end if
      end for

      /* swap the minimum element with the current element*/
      if indexMin != i  then
         swap list[min] and list[i]
      end if
   end for
    
end procedure

Example

Input  : [8, 5, 2, 6, 9, 3, 1, 4, 0, 7]
Output : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
### Tracking Issues
- [ ] #5329
- [ ] #5330
- [ ] #5331
- [ ] #5332
- [ ] #5333
- [ ] #5334
- [ ] #5335
- [ ] #5336
- [ ] #5337
- [ ] #5338
- [ ] #5339
- [ ] #5340
- [ ] #5341
- [ ] #5342
- [ ] #5343
- [ ] #5344
- [ ] #5345
- [ ] #5346
- [ ] #5347
- [ ] #5348
@harshraj8843 harshraj8843 added the auto-track Good First Issue Tracker label Jan 16, 2024
@codinasion-bot
Copy link

👋🏻 Hey @harshraj8843

💖 Thanks for opening this issue 💖

A team member should be by to give feedback soon.

@codinasion-bot codinasion-bot bot added the triage Waiting for review label Jan 16, 2024
@harshraj8843 harshraj8843 added program and removed triage Waiting for review labels Jan 16, 2024
@Viran1
Copy link

Viran1 commented Jan 30, 2024

!assign

@kolhesatish
Copy link

Can you assign this issue to me?

@nitin-pandita
Copy link

I would like to work on it

@harshraj8843
Copy link
Contributor Author

You can comment !assign on any good first issue you want to contribute to, to be auto-assigned

!assign

@nitin-pandita
Copy link

!assign

1 similar comment
@khizer-flow
Copy link
Contributor

!assign

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-track Good First Issue Tracker program
Projects
None yet
Development

No branches or pull requests

5 participants