Selection Sort Code in Java | DSA
ฝัง
- เผยแพร่เมื่อ 29 ก.ย. 2023
- Check out our courses:
Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : bit.ly/java-spring-cloud
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : bit.ly/TeluskoApp
Discord : / discord - วิทยาศาสตร์และเทคโนโลยี
yeah. Please keep uploading more videos on DSA
thank you sir. Could you make a video on explaining the design patterents and where they should be use
in real world applications
Make Videos on design patterns.
Nice Explanation Sir
--------------------------------------
Another logic
package Sorting;
import java.util.Arrays;
public class SelectionSort2 {
public static void main(String[] args) {
int[] arr = {6,9,1,2,3,0,12,4};
//int[] arr = {6,5,2,8,9,4};
int size = arr.length;
int maxIndex = -1;
System.out.println("Before Sorting : " +Arrays.toString(arr));
int k=size;
for(int i=0;i
👍👍
thank you sir
🙏
Swapping max with last position code
private static int[] selectionSort(int[] arr) {
int placeholder = 0;
int max = 0;
for(int i=arr.length-1;i>=0;i--){
max = i;
for(int temp=0;temparr[i])
max = temp;
}
placeholder = arr[i];
arr[i] = arr[max];
arr[max] = placeholder;
}
return arr;
}
2nd view❤❤
1st view
ow so basically it's a gold digger algorithm hahhahaa