sir ,the modification in above code by if condition
//if(end_row>start_row) will work fine for odd*odd matrix but now fails for even *even matrix.
For even no. of rows/column in sprial print
Hello @varu,
Please, share the code.
I’ll correct it and would explain reason for what you have asked.
and I think this should be:
if(end_row>start_row)
this:
if(end_row>=start_row)
code is in video of spiral print in 2d arrays
Hello @S18ML0016,
That code is working fine.
I have myself tested it for many different cases.
Suggestion:
retwatch the entire video.
write a code and run it on the test case you think it will fail for.
If it still doesn’t work, share it with me.
Hope, this would help.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.