Spiral Traversal - Solution | 2-D Arrays | Data Structure and Algorithms in JAVA

  Рет қаралды 81,221

Pepcoding

Pepcoding

Күн бұрын

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the solution where we are required to traverse spirally in a 2d array and display the elements of the 2d array in the same manner. For a better understanding of the problem, click here: • Spiral Traversal - Que...
For a better experience and more exercises, VISIT: www.pepcoding....
#pepcoding #programming #freeonlinecourses
Have a look at our result: www.pepcoding....
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education

Пікірлер: 164
@lokeshnegi5051
@lokeshnegi5051 3 жыл бұрын
before watching this video i was thinking the problem is so tough,but sir your explanation really changed my mind.
@nishantsharma8776
@nishantsharma8776 4 жыл бұрын
mene pure youtube par aisa koi tutor nahi dekha you are extraordinary.and you deserve more Subscribers.mughe to ye samagh nahi aa RHA log etna accha channel leave krke or channels ko 100-100K subscriber kaise de dete hai
@Pepcoding
@Pepcoding 4 жыл бұрын
bhai linkedin/fb pe ek post likh do, ya college mei webinar kra do. Viewers ko pta chal jaega. Sabka bhla hoga. Hmara bhi, bacho ka bhi
@shivendrapathak8480
@shivendrapathak8480 4 жыл бұрын
@@Pepcoding you are an extraordinary teacher and you are doing so much effort to prepare us from zero to pro level.I'm referring to all my friends to join this channel. Thankyou! so much sir.
@ashishSinghSengar17
@ashishSinghSengar17 3 жыл бұрын
@@Pepcoding I'll surely write about your channel on Quora and LinkedIn. You're one of the finest teacher I ever saw. Kaash, aapke channel k baare m pehle pata hota. Now, I'm in 6th sem, still have one year left. Learning from you everyday, sir.
@abhishekanand5898
@abhishekanand5898 3 жыл бұрын
@@ashishSinghSengar17 It is never too late bhaiii...jb start ki tab accha...pelo accha se..
@DevilaBakrania
@DevilaBakrania 3 жыл бұрын
Blown away by the explanation!! Hats Off you made it super smooth + I remembered the logic right away ! This is my first video of Pepcoding.. You made it so easy.
@democrats9579
@democrats9579 3 жыл бұрын
What an Explanation! This is amazing. Thank You!
@ANUJGUPTA-pc7tf
@ANUJGUPTA-pc7tf Жыл бұрын
Sir what about the structure...? What if we want to maintain the structure of matrix after spiral...!
@CSBDPSAHITHIRANI
@CSBDPSAHITHIRANI 3 жыл бұрын
You make any difficult problem very very simple. Thank you so much!!
@Pepcoding
@Pepcoding 3 жыл бұрын
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, we request a review g.page/Pepcoding/review?rc You can subscribe to our channel here kzbin.infoabout?view_as=subscriber
@justaRidhaMthinGs
@justaRidhaMthinGs Жыл бұрын
rather than write count and total elements just write "if(maxr < minr ) return; " after the loop of bottom wall
@asan9657
@asan9657 2 жыл бұрын
Maza Agaya sir I wish I could study the complete syllabus of DSA from you👌
@vishalpuri9360
@vishalpuri9360 3 жыл бұрын
haven't seen a teacher like you before i wish i could meet you in my life ; you are legend sumeet sir. My coding skills are improving day by day nd it is just because of you sir. you are really a god for me sir you are the best teacher. lots of respect and love from my side sir.
@rayedsafdar3684
@rayedsafdar3684 2 жыл бұрын
Just keep practicing and you'll meet him when he'll take ur interview
@honey.hemant_
@honey.hemant_ Жыл бұрын
Can i use while(minc
@rohitmadaan6679
@rohitmadaan6679 2 жыл бұрын
I tried this question in which spiral starting from left... my code passed in all test cases... thanks for the wonderful explanation ... now i'm perfect in this question. thanks alot
@adityaverma8463
@adityaverma8463 2 жыл бұрын
Sir Max column ko array[0]. length kyu liye ?
@jeshar7720
@jeshar7720 2 жыл бұрын
didn't even think of the box approach
@BronsonMendonca
@BronsonMendonca 2 жыл бұрын
Thank you for this super simple explanation!!
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad it was helpful! for better experience and well organised content sign up on nados.io and start learning.
@shri.d7399
@shri.d7399 14 күн бұрын
Its not printimg 2 nd 3 the inner line
@bhupeshpattanaik7150
@bhupeshpattanaik7150 3 жыл бұрын
Pep is pronounced as pip for python users 🤣. Pip instal ....
@9893011111
@9893011111 Жыл бұрын
Are j ko toh declare kiya hi nahi... Build kaise hua??
@amannegi8256
@amannegi8256 3 жыл бұрын
G.O.A.T
@mohammedabdulaziz4400
@mohammedabdulaziz4400 2 жыл бұрын
Kya baat hai sir, kyaabbaat hai sir!!. Yeh baat hai sir!
@neelshah4812
@neelshah4812 4 жыл бұрын
sir i think it should be (cnt
@vedantgolash6084
@vedantgolash6084 3 жыл бұрын
its starting from 0 , so sir wala correct hai
@vinayjain7263
@vinayjain7263 2 жыл бұрын
bhai bata raha hai ye chilla isse jyada pyar se to mera math ka teacher padata hai
@vikaskumarnitrr
@vikaskumarnitrr 2 жыл бұрын
Dekho bhai aisa hai Nahi koi sumeet sir jaisa hai
@Iamnoone56
@Iamnoone56 3 жыл бұрын
shandaar jabardast zindabaad sir..aaj tulsidas hote to DSAcharitramanas likhte apko idol mnake ;P
@Pepcoding
@Pepcoding 3 жыл бұрын
Haha...thankyou😋 If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@satadrumondal8671
@satadrumondal8671 3 жыл бұрын
Sir great video 👌.Sir I request you to put more program on array and recrusion.
@deepanshusaxena7471
@deepanshusaxena7471 Жыл бұрын
Great explaination.
@PROTECHRAHUL
@PROTECHRAHUL 3 жыл бұрын
Easiest explanation ever😎
@user-Abhi_7544pandey
@user-Abhi_7544pandey Жыл бұрын
sir n = 0 m = 0 put krne pe out of bound aa rha hai
@shivamverma-mt6kp
@shivamverma-mt6kp 2 жыл бұрын
Thanks a lot, Sir
@acciocoder6596
@acciocoder6596 2 жыл бұрын
Awesome sir...really loves alot ur way of explaining
@Pepcoding
@Pepcoding 2 жыл бұрын
Thanks a ton. For better experience visit on nados.pepcoding.com Also follow our Instagram account to stay updated. instagram.com/pepcoding/
@ishanshah3309
@ishanshah3309 2 жыл бұрын
This is seriously good explanation. I mean his explanation made this leetcode medium problem look like a very easy problem.
@vinayjangra1401
@vinayjangra1401 2 жыл бұрын
ye leetcode ka hai?
@ManishJain2
@ManishJain2 2 жыл бұрын
@@vinayjangra1401 Problem 54
@sahilmehra290
@sahilmehra290 2 жыл бұрын
count
@tanmaythaker2905
@tanmaythaker2905 4 жыл бұрын
What an explanation! Loved it!
@Pepcoding
@Pepcoding 4 жыл бұрын
Glad you liked it!
@yogeshmusale1188
@yogeshmusale1188 2 жыл бұрын
Thank you for teaching this program.🙏🙏
@pYthonroasT
@pYthonroasT 2 жыл бұрын
thanks
@kamalkumar7133
@kamalkumar7133 2 жыл бұрын
smoooooooth 💕
@rohitmadaan6679
@rohitmadaan6679 2 жыл бұрын
Great explanation, Subscribed❤
@AmitKumar-fk8mm
@AmitKumar-fk8mm Жыл бұрын
in guru ki to puja karo bhai
@sanyasareen393
@sanyasareen393 4 жыл бұрын
Sir, Aapne bohot achhe se explain kiya hai solution. Sab samjh aa gya thank you
@Pepcoding
@Pepcoding 4 жыл бұрын
I am glad. Keep learning.
@saneetkaul8150
@saneetkaul8150 2 жыл бұрын
Thank you
@akshayagrawal2222
@akshayagrawal2222 2 жыл бұрын
Sumit bhai you are great...kitna simple explaination
@deepanshum5967
@deepanshum5967 3 жыл бұрын
Thankyou so much sir
@iffyaiyan8942
@iffyaiyan8942 3 жыл бұрын
Thanks for this video Sir, it cleared all doubts related to this type of problem
@Pepcoding
@Pepcoding 3 жыл бұрын
You are most welcome
@pavanrameshghate5416
@pavanrameshghate5416 3 жыл бұрын
Other youtubers: so we do with algorithm Bhaiya: hold my pen
@nipunsharma2670
@nipunsharma2670 2 жыл бұрын
very nice explanation .Thanku sir!!
@simardeepkaur8275
@simardeepkaur8275 2 жыл бұрын
awesome
@shashwatkrishnashukla2284
@shashwatkrishnashukla2284 2 жыл бұрын
SIR you are OP,pls make a video on spiral traversal of 3D matrix too
@manthanvijaywargia2041
@manthanvijaywargia2041 2 жыл бұрын
Thanks a ton for the best explanation sir 🙏🙏🙏🙏🙏🙏
@venom3380
@venom3380 Жыл бұрын
Thankyou for the videos Sir! hoping to complete most of it by the end of 2022😄
@akshivmittal1188
@akshivmittal1188 9 ай бұрын
mazza aa gya
@tubakhalid5222
@tubakhalid5222 3 жыл бұрын
You are one of a kind sir ! Gonna enroll in your course very soon !!!!
@yogeshpandey730
@yogeshpandey730 2 жыл бұрын
very well explained, i can't find such an easy explanation over internet . Thank you Sumeet sir.
@abhinavvgoyall
@abhinavvgoyall Жыл бұрын
Made it so simple. thank you!
@afzalriz449
@afzalriz449 2 жыл бұрын
most underrated channel. Great Explanation. 👏
@azeemali6865
@azeemali6865 2 жыл бұрын
the best explanation ever...
@Pepcoding
@Pepcoding 2 жыл бұрын
Keep learning. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@kritikasharma3331
@kritikasharma3331 2 жыл бұрын
Best teacher in the world !!! I'm amazed by the explanation.
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad you loved it! For better experience and well organised content sign up on nados.io and start learning.
@codebits2120
@codebits2120 3 жыл бұрын
Will it work ?if we write in the condition of while loop like : while(int k
@faizanhaider3953
@faizanhaider3953 2 жыл бұрын
Sir aapne jo smjhaya h naaa... Kasam se maza aagaya... Bahut jbr10
@neelshah4812
@neelshah4812 4 жыл бұрын
sir, you make the explanation very interesting nd addictive..maza aagya
@Pepcoding
@Pepcoding 4 жыл бұрын
Keep watching
@namanmalhotra6386
@namanmalhotra6386 4 жыл бұрын
sir you are doing a great job.Thankyou sir.
@Pepcoding
@Pepcoding 4 жыл бұрын
Thanks and welcome
@bite027_ketansharma6
@bite027_ketansharma6 2 жыл бұрын
maza aa gya!
@Satishkumar-rx7oy
@Satishkumar-rx7oy 2 жыл бұрын
this video is really helpful, thanks for making this
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad it was helpful! Keep learning. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@satyaganesh672
@satyaganesh672 2 жыл бұрын
bro ur a saviour.. ur explanations are god level explanations
@sayantansadhu6380
@sayantansadhu6380 2 жыл бұрын
Extremely beautiful and simple explanation ❤️
@sakshiaggarwal6199
@sakshiaggarwal6199 3 жыл бұрын
Thank you so much sir!! You're amazing
@Pepcoding
@Pepcoding 3 жыл бұрын
Keep supporting and keep loving Pepcoding😊
@shalusingh9593
@shalusingh9593 3 жыл бұрын
time limit exceeded showing
@nileshupadhayay5971
@nileshupadhayay5971 3 жыл бұрын
same problem in bottom wall loop..found any solution?
@abhishekankitsoti
@abhishekankitsoti 3 жыл бұрын
I was getting TLE in java...didn't find a successful Java submission...ran in c++...submitted successfully...
@hinamankani5319
@hinamankani5319 4 жыл бұрын
Wow i m so glad,i did this question on my own😊😊
@Pepcoding
@Pepcoding 4 жыл бұрын
Yay!! I am glad too. Keep learning
@vipulkumar3752
@vipulkumar3752 3 жыл бұрын
very helpful thank you sir
@piyush_sh98
@piyush_sh98 2 жыл бұрын
Most underrated channel for coding 🙌
@codelite700
@codelite700 Жыл бұрын
Sir made the while loop terminating condition so damn simple & cool.
@24381498
@24381498 3 жыл бұрын
Amazing explanation Sumeet sir. Thanks
@sarthaknikhal5540
@sarthaknikhal5540 3 жыл бұрын
SIr, what do you mean by, "dry run karke dekho."?
@abhishekvishwakarma9045
@abhishekvishwakarma9045 2 жыл бұрын
awesome explanation sir, I will never forget this logic
@abhisheksoti1115
@abhisheksoti1115 2 жыл бұрын
Hello Sir, Big Fan, great explanation... but there is one small improvement that I could think of...instead of checking cnt < tne inside the for loop condition, if we could add if(cnt == tne){ break; } between left and bottom, bottom and right, right and top, there would be a few less condition checks in total. I have started practicing on NADOS, great platform Sir. Thank you so much.
@Pepcoding
@Pepcoding 2 жыл бұрын
For better experience and well-arranged content visit- nados.pepcoding.com Also you can post your query on community tab. Don't forget to follow us on Instagram instagram.com/pepcoding/
@arvindg553
@arvindg553 2 жыл бұрын
U r awesome awesome awesome sir
@geetanegi2736
@geetanegi2736 3 жыл бұрын
🔥🔥mza agya. Jai ho sir ki.
@Pepcoding
@Pepcoding 3 жыл бұрын
thank you for motivation beta
@santanukumar5714
@santanukumar5714 3 жыл бұрын
at 5:17 can u explain why u take j< arr[0].length instead of arr.lenghth
@santanukumar5714
@santanukumar5714 3 жыл бұрын
@@nikhilflautist ya sir i understand it And thank u for giving time to clear my doubt👍.
@anandkumar-ko5ok
@anandkumar-ko5ok 3 жыл бұрын
great work pepcoding
@thesurajpatade
@thesurajpatade 3 жыл бұрын
Amazing explanation, planning to binge watch all problems!!
@sandipdeb5859
@sandipdeb5859 2 жыл бұрын
Thank you so much sir ❤
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad it helped! Keep learning. And for better experience and well organised content visit nados.pepcoding.com
@jayantaghosh5259
@jayantaghosh5259 3 жыл бұрын
Thank you sir🥺🥺
@Pepcoding
@Pepcoding 3 жыл бұрын
You are welcome and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@kamalnayan5331
@kamalnayan5331 3 жыл бұрын
@@Pepcoding Upvoted sir.
@rounakjoshi6680
@rounakjoshi6680 2 жыл бұрын
Loved the way to teach🙏
@harshadashinde1796
@harshadashinde1796 2 жыл бұрын
thanks for this sir..
@anckoor
@anckoor 2 жыл бұрын
nice
@Pepcoding
@Pepcoding 2 жыл бұрын
Keep learning. And for better experience and well organised content visit nados.pepcoding.com
@arvindg553
@arvindg553 2 жыл бұрын
Best on youtube
@mohsinimam2048
@mohsinimam2048 3 жыл бұрын
Thank for such an easy explanation!
@anshutomar304
@anshutomar304 2 жыл бұрын
sir after running it an error occurs shows that there is an "not a statement" error in loops . what to do to fix it.
@Pepcoding
@Pepcoding 2 жыл бұрын
For better experience and precisely organised content visit - naods.pepcoding.com Also you can post such query on community tab. Don't forget to follow us on Instagram instagram.com/pepcoding/
@puneetgupta2060
@puneetgupta2060 4 жыл бұрын
Apke tutorial bahut ache hai sir thanks for making the vedio
@Pepcoding
@Pepcoding 4 жыл бұрын
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like my efforts, I request a review g.page/Pepcoding/review?rc
@shashankchaturvedi7876
@shashankchaturvedi7876 3 жыл бұрын
best teacher on you tube
@crucialkali8983
@crucialkali8983 4 жыл бұрын
nice video dear ,and can you make video playlist on data structure in java:)
@Pepcoding
@Pepcoding 4 жыл бұрын
yahan hai playlist www.pepcoding.com/resources/online-java-foundation
@sharikkumar8581
@sharikkumar8581 3 жыл бұрын
Bahut khubsurat explanation sir....thank you :)
@Pepcoding
@Pepcoding 3 жыл бұрын
Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@ANUJKUMAR-wc9dz
@ANUJKUMAR-wc9dz 3 жыл бұрын
Time complexity going to be O(n) ?
@ANUJKUMAR-wc9dz
@ANUJKUMAR-wc9dz 3 жыл бұрын
@Himanshu Kataria is it based row and columns if is it based on 1d time complexity should be O(n) ?
@shreyanshjamuar8921
@shreyanshjamuar8921 3 жыл бұрын
Bro maza aa gya yaar,you r awesome sir.
@shivanshm1
@shivanshm1 3 жыл бұрын
ur best bro....such an intersting lecture...
@Pepcoding
@Pepcoding 3 жыл бұрын
Thanks a ton. thanks for motivation
@nandankakadiya1494
@nandankakadiya1494 3 жыл бұрын
Simply amazing 🔥
@akshyananda7219
@akshyananda7219 3 жыл бұрын
Awesome explanation. Thank you sir
@Pepcoding
@Pepcoding 3 жыл бұрын
Glad to know that you liked the content. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc
@harshchaudhary8182
@harshchaudhary8182 3 жыл бұрын
best tutorial.
@Pepcoding
@Pepcoding 3 жыл бұрын
Thankyou beta! Keep learning and keep supporting Pepcoding😊
@ArnabJhaYT
@ArnabJhaYT 2 жыл бұрын
Best explanation ever 😁😁😁
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad you liked it but for better experience and precisely arranged content. visit - nados.pepcoding.com
@ArnabJhaYT
@ArnabJhaYT 2 жыл бұрын
@@Pepcoding Yes sir, I am currently coding in nados and coming here for video solution
@AnkitKumar-fj8ex
@AnkitKumar-fj8ex 3 жыл бұрын
sir you are just awesome
@Pepcoding
@Pepcoding 3 жыл бұрын
Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
@AnkitKumar-fj8ex
@AnkitKumar-fj8ex 3 жыл бұрын
@@Pepcoding sure sir
@ayushgoel9584
@ayushgoel9584 4 жыл бұрын
bhaiya aaj hi poora 2d array upload kar do, aaj toh flow bna hua hai
@Pepcoding
@Pepcoding 4 жыл бұрын
hanji. aj poora 2d ho jaega. 1d ke bache hue questions ki bhi koshish rahegi
@vedantgolash6084
@vedantgolash6084 3 жыл бұрын
very nice explanation sir
@Pepcoding
@Pepcoding 3 жыл бұрын
Thank you for supporting
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 67 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 117 МЛН
Print Zig-Zag | Recursion for Beginners | Algorithms in JAVA
30:00
Spiral Traversal of a Matrix | Spiral Matrix
16:33
take U forward
Рет қаралды 216 М.
Trick for spiral matrix traversal
10:12
Techdose
Рет қаралды 206 М.
Hash Table - Data Structures & Algorithms Tutorials In Python #5
17:52