File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,17 @@ Reverse each row left $\leftrightarrow$ right.
167167* Example*
168168
169169$$
170- \text{Input: }\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}
170+ \text{Input: }
171+ \begin{bmatrix}
172+ 1 & 2 & 3 \\
173+ 4 & 5 & 6
174+ \end{bmatrix}
171175\quad\Rightarrow\quad
172- \text{Output: }\begin{bmatrix}3&2&1\\6&5&4\end{bmatrix}
176+ \text{Output: }
177+ \begin{bmatrix}
178+ 3 & 2 & 1 \\
179+ 6 & 5 & 4
180+ \end{bmatrix}
173181$$
174182
175183* Time: $O(R\cdot C)$
@@ -184,9 +192,19 @@ Reverse each column top $\leftrightarrow$ bottom.
184192* Example*
185193
186194$$
187- \text{Input: }\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}
195+ \text{Input: }
196+ \begin{bmatrix}
197+ 1 & 2 & 3 \\
198+ 4 & 5 & 6 \\
199+ 7 & 8 & 9
200+ \end{bmatrix}
188201\quad\Rightarrow\quad
189- \text{Output: }\begin{bmatrix}7&8&9\\4&5&6\\1&2&3\end{bmatrix}
202+ \text{Output: }
203+ \begin{bmatrix}
204+ 7 & 8 & 9 \\
205+ 4 & 5 & 6 \\
206+ 1 & 2 & 3
207+ \end{bmatrix}
190208$$
191209
192210* Time: $O(R\cdot C)$
You can’t perform that action at this time.
0 commit comments