Skip to content

Commit deeee57

Browse files
committed
✨ 添加新特性
1 parent b409d38 commit deeee57

File tree

2 files changed

+49
-9
lines changed

2 files changed

+49
-9
lines changed

src/main/java/com/crossoverjie/algorithm/TwoArray.java

+22-9
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,27 @@ public class TwoArray {
1515
private final static Logger LOGGER = LoggerFactory.getLogger(TwoArray.class);
1616

1717

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+
2740

2841
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

0 commit comments

Comments
 (0)