Skip to content

ShotsMan2/Bottom-Right-Serpentine-Matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bottom-Right Serpentine Matrix

This project implements a matrix filling algorithm that creates a Vertical Serpentine pattern starting from the Bottom-Right corner.

⚙️ Path Logic

The algorithm fills the matrix column by column, moving from Right to Left:

  1. Col $N-1$ (Rightmost): Fills Upwards ($\uparrow$)
  2. Col $N-2$: Fills Downwards ($\downarrow$)
  3. Col $N-3$: Fills Upwards ($\uparrow$) ...and so on.

🚀 Example Output (N=3)

Matches the 3rd pattern in the problem set:

9 4 3
8 5 2
7 6 1
  • 1 -> 3: Starts at [2][2], goes Up.
  • 4 -> 6: Moves to Col 1, goes Down.
  • 7 -> 9: Moves to Col 0, goes Up.

This repository demonstrates conditional loops and multidimensional array traversal in C.

About

A C algorithm that populates an NxN matrix with integers starting from the bottom-right corner. It traverses columns from right to left, alternating vertical directions (Up -> Down -> Up) to create a serpentine pattern.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages