Print Matrix in spiral form ( 2-D array)

Print matrix in spiral form. Print the 2-D array in spiral form.

Пікірлер: 152

  • @HendersonHood
    @HendersonHood4 жыл бұрын

    Very artfully described; this is by far the best explanation I have seen describing this algorithm.

  • @volcanopz6243
    @volcanopz62433 жыл бұрын

    I cannot believe how easy this was, Thank you for such great explanation

  • @huzaifashaikh932
    @huzaifashaikh9322 жыл бұрын

    I searched whole youtube but still wasn't satisfied with explanation, I got satisfied with only your explanation, it's the best explanation! keep posting new videos.

  • @jaswanthreddythummuru2210
    @jaswanthreddythummuru22103 жыл бұрын

    You nailed it!. Clear-Cut explanation. Keep posting algorithms.

  • @krishnaghosh1126
    @krishnaghosh11266 жыл бұрын

    Tomorrow is my ISC computer science practical 2018 ...this video is so helpful... great explanation sir😊

  • @daumtto
    @daumtto5 жыл бұрын

    Thank you sir. I think it was beyond my capabiliity of solving.. you made me understand this algorithm!

  • @ShinobiEngineer
    @ShinobiEngineer6 жыл бұрын

    #include int main() { printf("THANK YOU ! ! !"); return 0; }

  • @Jerry-by7cj
    @Jerry-by7cj5 жыл бұрын

    Easy to understand, thank you so much! Impressive!

  • @gujjulapradeepreddy3189
    @gujjulapradeepreddy31893 жыл бұрын

    Excellent explanation. Please upload more and more algorithms. Really the best explanation for complex algorithms.

  • @tapanjeetroy8266
    @tapanjeetroy82665 жыл бұрын

    Thanks for uploading it.. You are doing a great great job.. Please please upload more of such programming questions.. We really need it

  • @aniketkhare8635
    @aniketkhare86353 жыл бұрын

    everything explained in a simple and easy manner. Thanks a lot !

  • @danithakare889
    @danithakare889 Жыл бұрын

    sir you are really great mentor to teach alogoritham please to be continue and help us we are ready to take paid up subscription also

  • @NishantTaletiya
    @NishantTaletiya Жыл бұрын

    bahot bahot dhnyawad aapka. You explained it very easy and in briefly i understand it easily i think its very difficult but after your explaination it look like so easy.

  • @shubhamaths
    @shubhamaths Жыл бұрын

    Well explained ❤️ ignoring this video because of the Thumbnail but after watching all videos and still not understanding.. Then I clicked on this. ❤️ Agin it proves.. Don't judge a book by it's cover.

  • @azeeztaiwo2802
    @azeeztaiwo28025 жыл бұрын

    you did a good job at explaining the way your algorithm work.

  • @nitin-vlogs3189
    @nitin-vlogs31893 жыл бұрын

    Your explanation is awesome sir

  • @tuhinchandra8675
    @tuhinchandra86752 жыл бұрын

    Sir my heartiest thanks to u...❤️ amazing explanation.. I was struggling with this question for my practicalsss... Finally I understood the logic🙏

  • @59595915
    @595959154 жыл бұрын

    Awesome! Very simple and clear solution!

  • @AashishKumar-or9lu
    @AashishKumar-or9lu3 жыл бұрын

    Love from Nepal ! Sir you describe from scratch like a pro

  • @shivakumarpatil2952
    @shivakumarpatil29524 жыл бұрын

    Very nice and clear explanation. Helped a lot.

  • @GautamThapa-xs6ns
    @GautamThapa-xs6ns2 жыл бұрын

    So satisfied with your explanation thanks!

  • @bryanblakeney8881
    @bryanblakeney88815 жыл бұрын

    Learning so much from your videos. Thanks

  • @hoanganh7997
    @hoanganh79972 жыл бұрын

    i listen to a guy speak my mother language explain this and don't understand anything but i can understand it when listen to you , that't magical :)))

  • @rickychaitanya5216
    @rickychaitanya52162 жыл бұрын

    The best exaplaination soo far :) Thank you sir

  • @kaveridhore4398
    @kaveridhore4398 Жыл бұрын

    This problem is tough for beginner and you made this an easy! Thankyou so much.

  • @jokeofgames1409
    @jokeofgames1409 Жыл бұрын

    Beautifully explanained

  • @sazisgetaways1460
    @sazisgetaways14602 жыл бұрын

    You nailed it. Thank you... beautifully explained

  • @neelparekh3448
    @neelparekh34483 жыл бұрын

    Well explained and to the point. You've gained another subscriber.

  • @NishantRathoreXYZ
    @NishantRathoreXYZ11 ай бұрын

    Very helpful for me this video sir, I want to your all videos watch regularly jai hind for your motivation sir.

  • @gammax5446
    @gammax54465 жыл бұрын

    thanks for our explaination...Great work!!

  • @Avinashkumar-sw3rj
    @Avinashkumar-sw3rj4 жыл бұрын

    Thanks a lot.way of explaining is awesome.

  • @sandeepraja1470
    @sandeepraja14705 жыл бұрын

    Can you please explain the logic to print a matrix in spiral form starting from center (printing outwards)?

  • @riyanegi7502
    @riyanegi75023 жыл бұрын

    Well explained!! Each and every step was made clear . I really liked the way you explained

  • @mdtaha2335

    @mdtaha2335

    2 жыл бұрын

    apko coding ata hai

  • @armanmanukyan1970
    @armanmanukyan19703 жыл бұрын

    Excellent explanation. Many thanks.

  • @ridhamkaria8771
    @ridhamkaria87715 жыл бұрын

    explanation was from basic.Nice one. make a video on structure problems.

  • @girishtoshniwal5563
    @girishtoshniwal55633 жыл бұрын

    This is really crystal clear explanation. However, don't you think two if conditions outside for loops got interchanged? Because when columns are variable, you should refer to variable 'L' in if condition instead of 'k' and when rows are variable, you should refer to variable 'k' instead of 'L'.

  • @dhruvinbhatt6414
    @dhruvinbhatt6414 Жыл бұрын

    Very well explained 👍👍, thanks sir

  • @shamaparween7655
    @shamaparween76555 жыл бұрын

    Ur explaination way is very gud..

  • @Kaifa_ali
    @Kaifa_ali6 жыл бұрын

    very nice explaination youre killing it

  • @manasranjan4
    @manasranjan46 жыл бұрын

    Really very nice explanation. Great man

  • @prashanttiwari120
    @prashanttiwari1206 жыл бұрын

    great source to learn programming

  • @bhavyar2986
    @bhavyar29865 жыл бұрын

    amazing!! happy to subscribe!

  • @dhirajsinha8102
    @dhirajsinha81024 жыл бұрын

    best explanation thank you for existing

  • @software85696
    @software856963 жыл бұрын

    Does this algorithm work if the number of rows >= to the number of columns?

  • @vishwasmukund
    @vishwasmukund6 жыл бұрын

    Nice series !! Can you please cover matrix rotation clockwise and anti clockwise when you get a chance ?

  • @abhinavjangra7446
    @abhinavjangra74466 жыл бұрын

    Print matrix diagonally ..??

  • @sr_sudipta
    @sr_sudipta4 жыл бұрын

    It was simply awesome........thanks sir....

  • @VishnuPillai02
    @VishnuPillai026 жыл бұрын

    Thank You :) Well Explained.

  • @ganeshjaggineni4097
    @ganeshjaggineni40979 ай бұрын

    NICE SUPER EXCELLENT MOTIVATED

  • @analyticstamizan677
    @analyticstamizan6774 жыл бұрын

    superb...explaination sir..

  • @banothramesh9021
    @banothramesh90215 жыл бұрын

    Sir thanks for good explanation I need different type of output with explanation and explain what conditions are used

  • @saketpanchori6480
    @saketpanchori64805 жыл бұрын

    can you tell me how to use this in main function?

  • @ManishGupta-uj2kk
    @ManishGupta-uj2kk5 жыл бұрын

    i'm fan of your explanation......thnx.

  • @Ashwanikumar-qr2jj
    @Ashwanikumar-qr2jj2 жыл бұрын

    best explanation for beginners.

  • @softwareengineering101
    @softwareengineering1012 жыл бұрын

    Awesome explanation

  • @rudrajha1002
    @rudrajha100210 ай бұрын

    Superb sir...❤

  • @deniserea4774
    @deniserea47743 жыл бұрын

    Muy buena explicación!! Gracias

  • @praveenraj8674
    @praveenraj86745 жыл бұрын

    Superb explanation

  • @rosonerri-faithful
    @rosonerri-faithful3 жыл бұрын

    Thank you Sir. It was helpful 😄. Can you post the explanation video for Goldmine collection and sudoku problem?

  • @alyonachmil9781
    @alyonachmil97812 жыл бұрын

    Thanks. Very useful and understandable.

  • @riaganesha
    @riaganesha4 жыл бұрын

    Awesome video 👏🏻

  • @renjithr7676
    @renjithr76765 жыл бұрын

    very nice Explanation. Algorithm would be super cool to understand if you change l to first_column and k to first_row

  • @PrashantNigam

    @PrashantNigam

    5 жыл бұрын

    exactly

  • @SpectatorAlius

    @SpectatorAlius

    3 жыл бұрын

    @@PrashantNigam No, not exactly. The Java naming convention is camel case, not underscores. So firstCol and firstRow &c are much better.

  • @abhisekhagarwala9501
    @abhisekhagarwala95015 жыл бұрын

    sir i have implented exactly same code as yours but it prints some garbage value ...

  • @dileepkumarnag4967
    @dileepkumarnag49675 жыл бұрын

    very nice explanation sir

  • @adolfocarrillo248
    @adolfocarrillo2484 жыл бұрын

    Challenge here. Can you design an algorithm which prints out a line corresponding to a certain line equation? The line must be printed on a square Matrix, with any symbol you want like asterisks.

  • @koushikkumar481
    @koushikkumar4812 ай бұрын

    where are you sir your explanations are awesome hats off

  • @sam_s3344
    @sam_s33442 жыл бұрын

    Amazing explanation. Do you have the code for this?

  • @the-gray-haired-developer
    @the-gray-haired-developer5 жыл бұрын

    please add more videos on matrix related problems

  • @ZuleyenineIbneNoman
    @ZuleyenineIbneNoman5 жыл бұрын

    hey bro,I watched your video and you did a great job.pls make a video on backtracking and sieve of eratosthenes

  • @kidsfun381
    @kidsfun3815 жыл бұрын

    Realy nice explanation

  • @mchapman0071
    @mchapman00716 жыл бұрын

    Hi, first of all thanks for this explanation! It really helped. I also have a question. Why did you create the if statements k

  • @ArunKumarKarepu

    @ArunKumarKarepu

    6 жыл бұрын

    After while condition is satisfied, k is increased by one after first for loop and last_col is decreased by one after second for loop. So in order to traverse other values, these conditions needs to be checked.

  • @annakhomidova4687

    @annakhomidova4687

    2 жыл бұрын

    Thanks a lot for explanation! This is wery helpful!

  • @__sarik
    @__sarik3 жыл бұрын

    really good explanation

  • @ankitabhise3883
    @ankitabhise38833 жыл бұрын

    How to do Reverse spiral matrix?

  • @akhilsinghsanoria1258
    @akhilsinghsanoria12585 жыл бұрын

    in step 3 we have to print last row ,so why we do not mention that we are printing lastrow

  • @debojyotidas3260
    @debojyotidas32606 жыл бұрын

    Sir I have created the code of the matrix by my concept the program executed and displayed the matrix in spiral order but it shows array out of index.why is it showing it?

  • @balladofgaytony5725

    @balladofgaytony5725

    4 жыл бұрын

    because there was a mistake in code on desk.in first for change i=1 to i=0; because first index of array is 0

  • @atanasgeorgiev7073
    @atanasgeorgiev70736 жыл бұрын

    THANK YOU!!! :)

  • @orkhanibrahim
    @orkhanibrahim3 жыл бұрын

    what about printing not from row and column index from 0,0 .For example how can we print from 1,1

  • @bhupeshdavesar
    @bhupeshdavesar4 жыл бұрын

    [Solved the exceptions and edge cases] good explanation but the solution gives wrong results(extra values) for 4*5 arrays, it gives 21 values instead of 20 , gives 26 instead of 24 for 4* 6 , throws exception for 2*5. One possible measure is, instead of printing in each loop , collect output in ArrayList using .add instead of prints and introduce a variable count (int count = m * n ) and check count Code for reference public static void main(String[] args) { System.out.println(printSpiral( new int[][] { { 4, 5, 3, 3, 6 }, { 4, 5, 1, 7, 8 }, { 4, 5, 3, 3, 6 }, { 4, 5, 1, 7, 8 }})); } private static List printSpiral(int[][] arr) { // printSpiral(arr, 4, 5); return printSpiral(arr, arr.length, arr[0].length); } private static List printSpiral(int[][] arr, int m, int n) { List outputList = new ArrayList(); int firstRow = 0, firstColumn = 0, lastColmn = n - 1, lastRow = m - 1, elementCount = m * n; while (firstRow

  • @divyansheevarshney2476
    @divyansheevarshney24764 жыл бұрын

    awsmm explanation

  • @noobkirti8216
    @noobkirti82162 жыл бұрын

    Sir make video on objects oriented programming 🙏

  • @AshwaniKumar-bh8rl
    @AshwaniKumar-bh8rl5 жыл бұрын

    nice explanation

  • @nasiruddinkhan5665
    @nasiruddinkhan56655 жыл бұрын

    very well explained

  • @user-bi4gr7mr9g
    @user-bi4gr7mr9g3 жыл бұрын

    Thank you so much friend!! Now I can say easy-peasy, lemon squeezy 'bout this task!

  • @rishavraj3547

    @rishavraj3547

    2 жыл бұрын

    Are you cs go player 😂

  • @vishalkajale5073
    @vishalkajale50733 жыл бұрын

    good explanation.

  • @sssumeet
    @sssumeet2 жыл бұрын

    🙌

  • @anandraj9859
    @anandraj98593 жыл бұрын

    Explanation 🔥🔥🔥🔥🔥🔥🔥

  • @kiranki2007
    @kiranki20074 жыл бұрын

    Well explained .

  • @dhananjayjadhav7064
    @dhananjayjadhav70642 жыл бұрын

    When I search for an que and got you vidio my face is like 😊😊😊

  • @kiranbs5057
    @kiranbs50573 жыл бұрын

    Good Job . Thank you

  • @hemanthkommaraju1888
    @hemanthkommaraju18884 жыл бұрын

    sir please make a video on how to make hashing in c

  • @bhavatarora9602
    @bhavatarora96025 жыл бұрын

    Hi Sir , Please make video of Maximum Sum subMatrix in a matrix

  • @ermattonella
    @ermattonella4 жыл бұрын

    THANKS FOR THE HELP SIR

  • @darshansolanki5535
    @darshansolanki55353 жыл бұрын

    You are the best

  • @sarojsahoo8763
    @sarojsahoo87634 жыл бұрын

    Thanks a lot !

  • @NehaKumari-cx6un
    @NehaKumari-cx6un4 жыл бұрын

    👌👌👌

  • @9-1939
    @9-19392 жыл бұрын

    🔥🔥

  • @dhanalakshmiraj2631
    @dhanalakshmiraj26315 жыл бұрын

    explain this scenario please print java output AaBbCc

  • @amritgupta1792
    @amritgupta17926 жыл бұрын

    jalwa hai bhai tera bhi

  • @sonubansal6220
    @sonubansal62203 жыл бұрын

    it helped me alot thanks

  • @vimalv6341
    @vimalv63413 жыл бұрын

    very well explained but only one thing was missing i.e complexity by the way complexity is O(m*n)