File tree 2 files changed +49
-9
lines changed
src/main/java/com/crossoverjie/algorithm
2 files changed +49
-9
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,27 @@ public class TwoArray {
15
15
private final static Logger LOGGER = LoggerFactory .getLogger (TwoArray .class );
16
16
17
17
18
- int [][] matrix = new int [][]{
19
- {1 , 2 , 8 , 9 },
20
- {2 , 4 , 9 , 12 },
21
- {4 , 7 , 10 , 13 },
22
- {6 , 8 , 11 , 15 }
23
- };
24
-
25
- int rows = matrix .length ; // 数组的行数
26
- int cols = matrix [1 ].length ; // 数组行的列数
18
+
19
+
20
+ public static void main (String [] args ) {
21
+ int [][] matrix = new int [][]{
22
+ {1 , 2 , 8 , 9 },
23
+ {2 , 4 , 9 , 12 },
24
+ {4 , 7 , 10 , 13 },
25
+ {6 , 8 , 11 , 15 },
26
+ {7 , 9 , 12 , 16 }
27
+ };
28
+
29
+ // 数组的行数
30
+ int rows = matrix .length ;
31
+ // 数组行的列数
32
+ int cols = matrix [1 ].length ;
33
+
34
+ LOGGER .info (String .valueOf (rows ));
35
+ LOGGER .info (String .valueOf (cols ));
36
+
37
+ }
38
+
39
+
27
40
28
41
}
Original file line number Diff line number Diff line change
1
+ package com .crossoverjie .algorithm ;
2
+
3
+ import java .util .Stack ;
4
+
5
+ /**
6
+ * Function: 两个栈实现队列
7
+ *
8
+ * @author crossoverJie
9
+ * Date: 09/02/2018 23:51
10
+ * @since JDK 1.8
11
+ */
12
+ public class TwoStackQueue {
13
+
14
+ private Stack input = new Stack () ;
15
+ private Stack out = new Stack () ;
16
+
17
+
18
+ /**
19
+ * 写入队列
20
+ * @param object
21
+ */
22
+ private void appendTail (Object object ){
23
+ input .push (object ) ;
24
+ }
25
+
26
+
27
+ }
You can’t perform that action at this time.
0 commit comments