前言: 虽然java的API中说创建多线程的方式只有两种(There are two ways to create a new thread of execution),分别是继承 类创建和实现 接口创建,在上一篇博文中演示了这两种, "详见" ,但是JDK5.0以后新增了两种,分别是实现 接口创建 ...
分类:
编程语言 时间:
2020-01-04 20:36:33
阅读次数:
88
231. Power of Two(2的幂) 链接 https://leetcode cn.com/problems/power of two 题目 给定一个整数,编写一个函数来判断它是否是 2 的幂次方。 示例?1: 输入: 1 输出: true 解释: 20?= 1 示例 2: 输入: 16 输 ...
分类:
其他好文 时间:
2020-01-04 16:34:47
阅读次数:
56
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:
其他好文 时间:
2020-01-04 14:40:32
阅读次数:
74
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 ...
分类:
其他好文 时间:
2020-01-04 14:37:15
阅读次数:
81
ABC059D "Alice & Brown" In this game, there are two piles initially consisting of $X$ and $Y$ stones, respectively. Alice and Brown alternately perfor ...
分类:
其他好文 时间:
2020-01-04 01:17:34
阅读次数:
62
###Add Two Number本来是一道非常简单的题目原题目的意思是,给两个链表,两个链表都链尾是十进制的头部例如有链表形式 9->8->7 对应的十进制就是789,而后的操作时将两个链表相加并且合并到一个链表里面 ###第一次的解法我第一次是被结构体卡住了,才考研完,很多基础知识全忘了,比如构 ...
分类:
其他好文 时间:
2020-01-03 21:04:15
阅读次数:
79
可以直接用+ assert 'ab' == 'a' + 'b' 支持多行 def aMultilineString = '''line one line two line three''' out: Fri Jan 03 11:14:58 CST 2020: INFO: line oneline t ...
分类:
其他好文 时间:
2020-01-03 12:11:58
阅读次数:
105
题目 来源:力扣(LeetCode) 描述 我们提供了一个类: 三个不同的线程将会共用一个 Foo 实例。 线程 A 将会调用 one() 方法 线程 B 将会调用 two() 方法 线程 C 将会调用 three() 方法 请设计修改程序,以确保 two() 方法在 one() 方法之后被执行,t ...
分类:
其他好文 时间:
2020-01-02 15:40:57
阅读次数:
90
You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tu ...
分类:
其他好文 时间:
2020-01-01 13:29:36
阅读次数:
62
文章来源:嗨学网 敏而好学论坛www.piaodoo.com 欢迎大家相互学习 下面看下字符串List按照长度排序(python)的实现方法 myList = ['青海省','内蒙古自治区','西藏自治区','新疆维吾尔自治区','广西壮族自治区'] 1、首先得到每个字符串长度 2、排序,选择sor ...
分类:
编程语言 时间:
2020-01-01 12:07:13
阅读次数:
155