Want to know:
先swap upside down,再symmetric (转置) // first upside down for(int i=0; i<n/2; i++){ for(int j=0; j<n; j++){ int temp = matrix[i][j]; matrix[i][j] = matrix[n-1-i][j]; matrix[n-1-i][j] = temp; } } // then swap symmetrically for(int i=0; i<n; i++){ for(int j=i+1; j<n; j++){ int temp = matrix[i][j]; matrix[i][j] = matrix[j][i]; matrix[j][i] = temp; } }
Get a detailed, AI-powered explanation for this question and thousands more on StudyFetch.
Get the Answer for FreeHow StudyFetch Helps You Master This Topic
AI-Powered Answers
Get instant, detailed explanations powered by AI that understands your course material.
Deep Understanding
Go beyond surface-level answers with step-by-step breakdowns and examples.
Personalized Learning
Spark.E adapts to your learning style and helps you connect ideas.
Practice & Test
Turn any question into flashcards, quizzes, and practice tests to solidify your knowledge.
Explore More Questions
- A set of values and practices that support the active evolution of the design and architecture of a system while implementing new system capabilities.
- Les tableaux de valeurs pour les fonctions linéaires sont quoi ?
- helps decision maker by describing how changes in the state of nature probabilities and/or changes in the payoffs affect the recommended decision alternative