Selection Sort Algorithm | Lecture-38 | Java and DSA Foundation course

preview_player
Показать описание
There might be no such technical interview without problems on sorting algorithms. Most of the companies ask problems on sorting algorithms. In this lecture manvi maam will be sharing information regarding one of such sorting algorithm that is selection sort. We will be looking into the selection sort algorithm first and then will be implementing it. Since we have also seen bubble sort algorithm in the previous video, we will be doing a comparative analysis for making our understanding more clear. Happy learning, see you all in the lecture.

We insist that you practice with the class to learn in the best possible way.
So what are we waiting for?
Let us meet in the class!

Are you finding the classes helpful?
Stay tuned for more!

PW Skills is announcing the launch of the following programs,

Binary Batch:- Java-with-DSA-&-System-Design (Java with DSA & System Design)

Sigma Batch:- Full-Stack-Web-Development (MERN Stack)

Impact Batch:- Data-Science-Masters (Full Stack Data Science)

TIME STAMPS:
00:00 - Intro
00:16 - Recap
04:48 - Selection sort Algorithm
05:37 - Selection sort Algorithm Example
24:33 - Selection sort Algorithm Code
30:13 - Time & Space Complexity
35:33 - Is selection sort stable ?
38:49 - Summary
40:27 - Next Lecture
40:42 - Outro

#Coding #Java #Tutorial #BubbleSort #Sorting #Bubble #Problemsolving #Problem #Solving #Math #Programming #ProgrammingLanguages #PWSkillslab #PWSkills #CollegeWallah #Javalecture #Coding #DSA #Java #CollegeWallah #PhysicsWallah #PWSkill #JavaProgramming
Рекомендации по теме
Комментарии
Автор

PW Skills is announcing the launch of the following programs,

Binary Batch:- Java-with-DSA-&-System-Design (Java with DSA & System Design)

Sigma Batch:- Full-Stack-Web-Development (MERN Stack)

Impact Batch:- Data-Science-Masters (Full Stack Data Science)

CollegeWallahbyPW
Автор

don't know
may be she is naturally gifted in teaching.
next level ma'am please keep it up

AbdulRehman-eezc
Автор

tq manvi maam for this beautifull lecture.

johnsonsvaselly
Автор

code to sort in descending order : just change the compare sign in if block to >
// sorting in descending order
static void selectionSorting2(int[] arr){
int len = arr.length;

for(int i=0; i<len-1; i++){
int maxIndex = i;

for(int j =i+1; j<len; j++){
if(arr[j]>arr[maxIndex]){ // change the sign > to get the max index by comparing the elements
maxIndex = j;
}
}

if(maxIndex!=i){ // if we find some index greater than initial maxIndex we will swap otherwise chosen index is the maximum
int temp = arr[i];
arr[i] = arr[maxIndex];
arr[maxIndex] = temp;
}
}
}

Luffy_
Автор

mam assignment upload nahi ho rahi hai....

Naveenkumar-qsqd
Автор

mam can we use recursion in selection sort??

nishantsharma
Автор

Mam In bubble sort
While swaping we took
Int temp=a[j]
a[j]=a[j+1]
a[J+1]=temp
But why in selection sort we took
int temp=a[i]
a[i]=a[i+1]
a[i+1]=temp
So plz could u explain while we took a[j] in bubble while swaping
But in selection sort we took a[i]????

muhammadifran
Автор

Can anyone tell on using arithmetic operations for swapping instead of the temporary variable method, why i am not getting desired output?

abhijeetgupta
Автор

Plzz mam ek test krvaye abi tk k lecture ka

royalshorts
Автор

Mam please upload github link in Description

pushpendradubey
Автор

mam black background me mt likho code samjhne me problem ho rhi hai

sumittiwari
Автор

Mam kindly use c++ language in algorithm
I am from Pakistan and I am mostly watching your lecture

technicalknowledge