Skip to content

Spiral traversal of matrix in JAVA #273

@Onkar627

Description

@Onkar627

Enter your question -

Given a 2D array, print it in spiral form. See the following examples.
Input: 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
Output: 1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10

Enter link to the question(if question belongs to any online platform) -

https://www.geeksforgeeks.org/print-a-given-matrix-in-spiral-form/

Tags for the question(eg - Array, Basic, Stack, etc.) -

Array,Matrix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Level 110 PointsOnlineQuestion belongs to online platforms

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions