206. Reverse Linked List 【题意】 将整个链表进行翻转 【题解】 非递归的做法比较好理解。 递归的做法很巧妙。用tail指针保存最后一个节点,这个不难理解,主要是head->next->next = head ,假设链表为1->2->3->4, 当head->3时,head- ...
分类:
其他好文 时间:
2020-11-16 13:45:39
阅读次数:
12
Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide all the array by it and sum the result ...
分类:
其他好文 时间:
2020-11-13 13:21:44
阅读次数:
33
经典dfs将当前位置传入,标记和当前点一类的点,同时进行计数 class Solution { public int[] pondSizes(int[][] land) { List<Integer> res = new LinkedList<>(); int m = land.length,n = ...
分类:
其他好文 时间:
2020-11-13 13:11:37
阅读次数:
9
Config 简介 分布式系统中,由于服务数量非常多,配置文件分散在不同微服务项目中,管理极其不方便。为了方便配置文件集中管理,需要分布式配置中心组件。在Spring Cloud中,提供了Spring Cloud Config,它支持配置文件放在配置服务的本地,也支持配置文件放在远程仓库Git(Gi ...
分类:
编程语言 时间:
2020-11-13 12:46:07
阅读次数:
9
题目链接 链接:https://leetcode-cn.com/problems/reverse-linked-list/ 题目描述 反转一个单链表。 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 进阶: 你可以迭代或递归地反转链表。你能否用 ...
分类:
其他好文 时间:
2020-11-11 16:33:27
阅读次数:
7
class MinStack { Deque<Integer> stack; Deque<Integer> min_stack; /** initialize your data structure here. */ public MinStack() { stack = new LinkedLis ...
分类:
其他好文 时间:
2020-11-11 16:27:13
阅读次数:
9
tf.app.flags.DEFINE_integer('num_blocks', 1, 'Number of blocks in each attention') tf.app.flags.DEFINE_integer('num_heads', 8, 'Number of heads in eac ...
分类:
其他好文 时间:
2020-11-10 11:08:36
阅读次数:
6
class Solution { public List<List<Integer>> subsets(int[] nums) { List<List<Integer>> res = new ArrayList<>(); res.add(new ArrayList<>()); for(int i = ...
分类:
其他好文 时间:
2020-11-08 16:53:04
阅读次数:
16
1、为什么Java中1000==1000为false而100==100为true? 当 int 类型值 在 -127 到 127 之间,两个变量的引用地址是相同的。Integer.java 类,有一个内部私有类,IntegerCache.java缓存了从-128到127之间的所有的整数对象。 Int ...
分类:
编程语言 时间:
2020-11-08 16:41:31
阅读次数:
18
delphi TStringList 用法详解 //TStringList 常用方法与属性 :var List: TStringList; i: Integer;begin List := TStringList.Create; List.Add('Strings1'); {添加} List.Add ...