Skip to content

Latest commit

 

History

History
20 lines (17 loc) · 546 Bytes

File metadata and controls

20 lines (17 loc) · 546 Bytes

Matrix

2D array problems and matrix algorithms.

Key Concepts Covered

  • Matrix traversal patterns
  • Spiral traversal
  • Matrix rotation
  • Matrix multiplication
  • Searching in sorted matrix
  • Dynamic programming on grids
  • Path finding in matrix
  • Island problems

Tips

  • Draw the matrix and visualize the pattern
  • Watch out for row-major vs column-major order
  • Use direction arrays for 4-directional movement: dx[]={-1,1,0,0}, dy[]={0,0,-1,1}
  • Many matrix problems reduce to graph problems
  • Consider in-place operations to save space