2ez4me
2ez4me
全部文章
分类
复习(2)
题解(86)
归档
标签
去牛客网
登录
/
注册
2ez4me的博客
全部文章
(共88篇)
题解 | #实现二叉树先序,中序和后序遍历#
import java.util.*; /* public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; } */ public class Solution { /** * * @param...
Java
二叉树
2022-02-11
0
439
题解 | #滑动窗口的最大值#
import java.util.*; //利用堆的方法解决,大根堆堆顶是滑动窗口的最大值 public class Solution { public ArrayList<Integer> maxInWindows(int [] num, int size) { if(size...
Java
数组
队列
树状数组
2022-02-10
0
316
题解 | #翻转单词序列#
public class Solution { public String ReverseSentence(String str) { //特殊情况 if(str == "") return""; //一般情况 //按照空格分隔字符串 String[] strSpilt = str....
Java
字符串
2022-02-10
0
301
题解 | #删除链表中重复的结点#
/* public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } } */ import java.util.*; public class Solution { ...
Java
链表
2022-02-10
0
331
题解 | #复杂链表的复制#
/* public class RandomListNode { int label; RandomListNode next = null; RandomListNode random = null; RandomListNode(int label) { this.label = lab...
Java
链表
哈希表
2022-02-09
0
316
题解 | #判断一个链表是否为回文结构#
import java.util.*; /* public class ListNode { int val; ListNode next = null; } */ public class Solution { //利用栈FILO的特性,完成回文判断 public boolean isPai...
Java
栈
链表
2022-02-09
0
269
题解 | #顺时针旋转矩阵#
import java.util.*; public class Solution { //与顺时针打印矩阵相类似,确定左上和右下边界,由外向里将各边界上的数进行旋转 public int[][] rotateMatrix(int[][] mat, int n) { // write co...
Java
数组
2022-02-09
0
337
题解 | #顺时针打印矩阵#
import java.util.ArrayList; public class Solution { static ArrayList resultList = new ArrayList<>(); public ArrayList<Integer> printMatrix...
Java
数组
模拟
2022-02-09
1
374
题解 | #数组中重复的数字#
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param numbers int整型一维数组 * @return int整型 */ //本题寻找数组中的重复数...
Java
数组
哈希表
2022-02-05
0
440
题解 | #数组中的逆序对#
public class Solution { static int count = 0; public int InversePairs(int [] array) { // 核心思路是归并排序,与之类似的题目有小和问题 if (array == null && ar...
Java
数组
分治
2022-02-05
0
322
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页