PostgreSQL 使用 CREATE TABLE 语句来创建数据库表格。 语法 CREATE TABLE 语法格式如下: CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... co ...
分类:
数据库 时间:
2020-07-27 17:37:46
阅读次数:
104
Given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the s ...
分类:
其他好文 时间:
2020-07-27 15:58:17
阅读次数:
93
class Solution { public int countPairs(TreeNode root, int distance) { dfs(root,0,distance); return res; } private int res = 0; public List<Integer> df ...
分类:
其他好文 时间:
2020-07-27 13:50:30
阅读次数:
114
泛型泛型:可以在类或方法中预支地使用未知的类型。tips:一般在创建对象时,将未知的类型确定具体的类型。当没有指定泛型时,默认类型为Object类型。通过我们如下代码体验一下:publicclassGenericDemo2{publicstaticvoidmain(String[]args){Collection<String>list=newArrayList<String&g
分类:
其他好文 时间:
2020-07-27 09:55:32
阅读次数:
87
[编程题] lc 169. 多数元素 题目 输入输出 Java代码(方法1:借用哈希表计数) //方法1:借助哈希 public int majorityElement(int[] nums) { HashMap<Integer,Integer> map = new HashMap<>(); for ...
分类:
其他好文 时间:
2020-07-27 09:38:33
阅读次数:
51
package com.jeesite.modules.jiQiao.web;import java.util.stream.Stream;public class DemoMapTest07 { public static void main(String[] args) { // stream流 ...
分类:
其他好文 时间:
2020-07-26 22:59:16
阅读次数:
112
示例如下: boolean ? Object o1 : Object o2 编译时就必须保证o1和o2为同一类型变量 Object o = true ? new Integer(1) : new Double(2.0); System.out.println(o); //1.0 先把后边两个对象转换 ...
分类:
其他好文 时间:
2020-07-26 19:13:48
阅读次数:
71
题目 把十进制整数转化为二进制整数 输入: 2 0 -12 1 输出: 2-->10 0-->0 -12-->-1100 1-->1 思路: 1、定义一个私有的F方法,用于优化代码 2、用Scanner在main中实现键盘录入,变量为sc 3、使用while循环操作hasNext()方法,并调用F方 ...
分类:
其他好文 时间:
2020-07-26 15:59:24
阅读次数:
73
1,sorted 函数sorted 函数语法:sorted (iterable,key,reverse),一共有iterable,key,reverse这三个参数。 iterable表示可以迭代的对象,例如可以是dict.items()、dict.keys()等; key是一个函数,用来选取参与比较 ...
分类:
编程语言 时间:
2020-07-26 15:18:18
阅读次数:
67
1、常用的装饰器有:before_request、after_request(这两个装饰器有点类似于django的中间件组件) 源码: 1 def preprocess_request(self): 2 """Called before the request is dispatched. Call ...
分类:
其他好文 时间:
2020-07-26 01:48:46
阅读次数:
61