69 CS651 Lecture : DSA notes 45

9 views1 pages

Document Summary

L45: print matrix in spiral form | lesson 45 | dsa. In java | java for beginners | @codingninjasindia. Coding ninjas problem is print spiral matrix, so what we have to do in this problem. We have will be given a 2d mat 2d array or a matrix. we have to print it in spiral form and now what will be the spiral form of a matrix. So spiral form means we will be going through this matrix in a clockwise direction indexing i have done so for now what we are doing. This first row so a of k i will be the index. see this is for printer. This for loop is printing first row first row. This for. loop is for. printing last column so we are starting from k i and we are going till m. that is last row. So last column is n minus 1 fine.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions