Description You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists ...
分类:
其他好文 时间:
2020-07-19 15:47:40
阅读次数:
73
引言都说StringBuilder在处理字符串拼接上效率要强于String,但有时候我们的理解可能会存在一定的偏差。最近我在测试数据导入效率的时候就发现我以前对StringBuilder的部分理解是错误的。后来我通过实践测试+找原理的方式搞清楚了这块的逻辑。现在将过程分享给大家测试用例我们的代码在循环中拼接字符串一般有两种情况第一种就是每次循环将对象中的几个字段拼接成一个新字段,再赋值给对象第二种
分类:
其他好文 时间:
2020-07-19 13:54:37
阅读次数:
81
1.get: book = BookInfo.objects.get(id=100) #查数据库模型BookInfo中id为100的数据 2.all: book = BookInfo.objects.all() #查数据库模型BookInfo中所有数据 3.count: book = BookInf ...
分类:
其他好文 时间:
2020-07-19 11:54:47
阅读次数:
104
给定一个二叉树,返回它的中序 遍历。 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [1,3,2] 进阶: 递归算法很简单,你可以通过迭代算法完成吗? ## 迭代 class Solution: def inorderTraversal(self, root: TreeNod ...
分类:
其他好文 时间:
2020-07-19 11:38:09
阅读次数:
55
Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all ...
分类:
其他好文 时间:
2020-07-19 00:50:18
阅读次数:
85
Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one ...
分类:
其他好文 时间:
2020-07-18 22:21:25
阅读次数:
73
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat ...
分类:
其他好文 时间:
2020-07-18 21:49:07
阅读次数:
59
0.编写一个程序,统计当前目录下每个文件类型的文件数,程序实现如图: 代码实现: 1 import os 2 # 使用os.curdir表示当前目录更标准 3 all_files = os.listdir(os.curdir) 4 type_dict = dict() 5 6 for each_fi ...
分类:
编程语言 时间:
2020-07-18 19:45:56
阅读次数:
90
前后端分离的项目,接口文档的存在十分重要。与手动编写接口文档不同,swagger是一个自动生成接口文档的工具,在需求不断变更的环境下,手动编写文档的效率实在太低。与新版的swagger3相比swagger2配置更少,使用更加方便。 一、pom文件中引入Swagger3依赖 <dependency> ...
分类:
编程语言 时间:
2020-07-18 15:50:16
阅读次数:
397
1.空函数是不占字节的,还有就是typedef只是一个声明而已,也不占字节;枚举类型是用int型实现的,故占4个字节;联合类型中字节数是12+4(有一位是'\0') 2.调用无参构造函数即编译器默认生成的构造函数时,直接定义一个对象,不能在后面加一个括号,否则就为函数的定义,会产生错误。 3.#im ...
分类:
编程语言 时间:
2020-07-18 15:49:25
阅读次数:
61