上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 33 下一页
摘要: 图的广度优先遍历,,,没能做出来。。。 public int ladderLength(String beginWord, String endWord, List<String> wordList) { // 先将 wordList 放到哈希表里,便于判断某个单词是否在 wordList 里 Se 阅读全文
posted @ 2020-08-03 10:26 欣姐姐 阅读(156) 评论(0) 推荐(0)
摘要: 递归+回溯 完成! public List<List<Integer>> combine(int n, int k) { if(k>n){ return new ArrayList<>(); } List<List<Integer>> res = new ArrayList<>(); List<In 阅读全文
posted @ 2020-08-02 15:00 欣姐姐 阅读(173) 评论(0) 推荐(0)
摘要: 回溯 public List<List<Integer>> permuteUnique(int[] nums) { List<List<Integer>> result = new ArrayList<>(); boolean[] visited = new boolean[nums.length] 阅读全文
posted @ 2020-07-30 17:33 欣姐姐 阅读(162) 评论(0) 推荐(0)
摘要: 回溯 public List<List<Integer>> permute(int[] nums) { List<List<Integer>> result = new ArrayList<>(); boolean[] visited = new boolean[nums.length]; back 阅读全文
posted @ 2020-07-30 17:08 欣姐姐 阅读(125) 评论(0) 推荐(0)
摘要: public List<List<Integer>> subsetsWithDup(int[] nums) { Arrays.sort(nums); List<List<Integer>> result = new ArrayList<>(); List<Integer> path = new Ar 阅读全文
posted @ 2020-07-30 16:32 欣姐姐 阅读(142) 评论(0) 推荐(0)
摘要: 递归 public List<List<Integer>> subsets(int[] nums) { Arrays.sort(nums); List<List<Integer>> result = new ArrayList<>(); List<Integer> path = new ArrayL 阅读全文
posted @ 2020-07-30 11:46 欣姐姐 阅读(122) 评论(0) 推荐(0)
摘要: ARP的功能是——在32bit的IP地址和采用不同网络技术的硬件地址之间提供动态映射。 以太网封装格式(RFC 894) 用于以太网的ARP请求或应答分组格式 以太网目的地址全1的特殊地址是广播地址; 帧类型:0x0806; 硬件类型:值为1表示以太网地址; 协议类型:0x0800表示IP地址; 硬 阅读全文
posted @ 2020-07-23 11:46 欣姐姐 阅读(346) 评论(0) 推荐(0)
摘要: 暴力法,多次循环检查,直到满足条件。 public int candy(int[] ratings) { int[] candies = new int[ratings.length]; Arrays.fill(candies,1); boolean flag = true; int sum = 0 阅读全文
posted @ 2020-07-13 16:04 欣姐姐 阅读(166) 评论(0) 推荐(0)
摘要: 自己完成了,但是效果好像并不怎么样 public int canCompleteCircuit(int[] gas, int[] cost) { int len = gas.length; if(len == 1){ return gas[0] >= cost[0]?0:-1; } int sum1 阅读全文
posted @ 2020-07-13 10:46 欣姐姐 阅读(168) 评论(0) 推荐(0)
摘要: public void setZeroes(int[][] matrix) { //遍历矩阵,标记要置零的行列,之后进行置零。 ArrayList<Integer> row = new ArrayList<>(); ArrayList<Integer> col = new ArrayList<>() 阅读全文
posted @ 2020-07-10 17:47 欣姐姐 阅读(181) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 33 下一页