Problem Solving on Sorting Algorithms-1 | Lecture-38 | C++ and DSA Foundation course

preview_player
Показать описание
How were the last three classes on sorting? We hope you are following the lectures regularly. In the series of sorting, today Urvi mam is going to cover a few problems based on the sorting algorithms covered so far.

Are we ready?
See you 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 - Introduction
00:23 - Recap
01:20 - Today's checklist
01:58 - Given an integer arr, move all 0s to the end of it while maintaining the relative order of the non-zero elements
04:19 - Solution discussion
17:13 - Code
20:46 - Dry run
27:44 - Given an array of names of fruits, sort it in the lexicographical order using selection sort.
29:56 - Solution discussion
37:02 - Code
42:42 - Summary

#DSA #ProblemSolving #Lecture38 #Sorting #BasicProblems #DataStructures #CodingChallenges #Debugging #SortingAlgorithms #LogicalThinking #PWskills #CollegeWallah #PhysicsWallah
Рекомендации по теме
Комментарии
Автор

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
Автор

Question 1 :
Solution :

void ShiftZeros(vector<int> &v){
int firstZero = 0;
for(int i = 0 ; i < v.size() ; i++){
if (v[i] != 0){
swap(v[i], v[firstZero]);
firstZero +=1;
}
}
}

AdityaPandey-vutf
Автор

[38].I have seen this lecture today.I have completely understood all the concepts you explained in class. Your teaching method was very simple and effective, which made me understand everything easily. I am very grateful to you for your guidance and hard work. Your student, [Ayush & Adarsh]...🫡❤️
6TH JULY 2024....

NirajKumarPandey
Автор

thanks we were in reed of this lecture to revise

yashwairagade
Автор

Plz also do a series on javascripts related r python related DSA

shamstabrez
Автор

Is dsa advanced also completed in the free course of c++ ??

pranjalrai
Автор

can we follow 2 pointer approach in 1st question ma'am?

aadyavibhuti
Автор

Sir please launch "WBJEE TEST Series 2023
Sir please please
We need this sir

gourangadas
Автор

Mam kya hum aisa ni kar sakte kya ki all digit ko 1 se multiply kr de or jis digit se multiply hoke 0 value aa rha hu use last me kr de or baki sabko apne hi position pe rahne de

Phoniex_world
Автор

void Sorting(vector<int> &v){
int n=v.size();
for(int i=0; i<n-1; i++){
for(int j=0; j<n-1-i; j++){
if(v[j]==0){
if(v[j]<=v[j+1]){
swap(v[j], v[j+1]);
}
}
}
}

ArtiSingh-njse
Автор

Input and output class ka note kab milega?

sachinkumarsahu
Автор

Hey is there any paid coding language course for full syllabus

Xyz-owds
Автор

sort and reverse is the best apporach and you are saying wrong in the video

AbhishekGupta-ejvw
Автор

Sir pls nimcet exam ke liye bhi batch laiye

akshay
Автор

Koi batao kiya ye sb coding seekh kar drone aur arudino ki programming kr payenge

mechXplorer
Автор

I want to join data science course but course requirement is minimum i3 processor but I have amd A4 3350b I don't know this processor equivalent to required processor or not? Please reply frnds

cricjack
Автор

Mem mera cource me join nahu ho raha email id not velid aa raha he 😭😭

Hettpanchal
Автор

Mem login kyu nahi ho raha web series me ?
Email id not verified aa raha he
Mem please solve karo is problem ko

Hettpanchal
Автор

this is my code for first question, i done in seven minutes with O(n), if you like that, then upvote my comment

int left=0;
int right=v.size()-1;
for(int i=left; i<right; i++){
if(v[i]==0 && v[i+1]!=0) swap(v[i], v[i+1]);
if(i<right && i==6) i=left++;
}
for(int i=0; i<v.size(); i++) cout<<v[i]<<" ";

aixarjun