猿辅导一面凉经
- 项目介绍
- SpringBoot 自动配置原理
- SpringCloud中Eureka服务注册中心和Zuul网关的原理
- 数据库的隔离级别,如何实现可重复读
- 数据库的索引有哪些,介绍B+树索引
- Redis的线程模型,常用的数据结构
- RabbitMQ的消息模型
class Solution {
public int maxAreaOfIsland(int[][] grid) {
int row = grid.length;
if (row == 0){
return 0;
}
int col = grid[0].length;
int result = 0;
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
if (grid[i][j] == 1){
result = Math.max(result, dfs(grid,i,j));
}
}
}
return result;
}
private int dfs(int[][] grid, int i, int j) {
if (i < 0 || i == grid.length || j < 0 || j == grid[0].length || grid[i][j] == 0){
return 0;
}
grid[i][j] = 0;
return dfs(grid, i - 1, j) + dfs(grid, i + 1, j) + dfs(grid, i, j - 1) + dfs(grid, i, j + 1) + 1;
}
} 编程题:一个栈中存放无序数字,使用额外空间栈对其进行排序
public class Solution {
public Stack<Integer> sort(Stack<Integer> stack){
Stack<Integer> s2 = new Stack<>();
int temp;
while (!stack.isEmpty()){
temp = stack.pop();
while (!s2.isEmpty() && s2.peek() > temp){
stack.push(s2.pop());
}
s2.push(temp);
}
return s2;
}
} -----------------------------------------------反问
技术栈是否匹配
面试评价(面试官只说了一句话:代码要写的简洁)
透心凉~~~~~~~~~~~~~~~~~~~~~~~
曼迪匹艾公司福利 121人发布