167. 两数之和 II - 输入有序数组 题目来源:力扣(LeetCode) https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted 题目 给定一个已按照升序排列 的有序数组,找到两个数使得它们相加之和等于目标数。 函数应 ...
分类:
编程语言 时间:
2020-07-20 20:30:25
阅读次数:
87
bootstrap table字段太长,显示省略号,鼠标停留显示文字 {field: 'content_two', title: __('content_two') , formatter : function(value, row, index, field){ return "<span sty ...
分类:
其他好文 时间:
2020-07-20 15:45:03
阅读次数:
142
1、展开操作符 顾名思义,用于对象或数组之前的展开操作符(…),将一个结构展开为列表。演示一下: let firstHalf = [ one , two ];let secondHalf = [ three , four , ...firstHalf]; 这种写法够优雅,够简洁吧?如果不用展开操作符 ...
分类:
其他好文 时间:
2020-07-20 10:39:44
阅读次数:
69
class Solution { public List<Integer> getRow(int rowIndex) { Integer[] res = new Integer[rowIndex+1]; Arrays.fill(res,1); for(int i = 1; i <= rowIndex ...
分类:
编程语言 时间:
2020-07-19 17:46:05
阅读次数:
79
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
package LeetCode_1060 /** * 1060. Missing Element in Sorted Array * (Prime) * Given a sorted array A of unique numbers, find the K-th missing number s ...
分类:
其他好文 时间:
2020-07-19 00:49:27
阅读次数:
93
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
一、开篇 Stream?其实就是处理集合的一种形式,称之为流,在Java8中被引入,可被Collection中的子类调用。 作用?简化代码,提升你的开发效率。 不会?看完这篇你就能自己上手了! 二、实例 首先将你的集合处理成流,才可以使用此API。 Stream<String> stream = l ...
分类:
编程语言 时间:
2020-07-18 19:59:28
阅读次数:
65
1 INSERTION - SORT (A)2 for j= 2 to A.length 3 key = A[j] 4 // Insert A[j] into the sorted sequence A[1..j-1] 5 i = j - 1 6 while i>0 and A[i]>key 7 A ...
分类:
编程语言 时间:
2020-07-18 16:05:26
阅读次数:
68
Java顺序查找、二分查找 查找算法中顺序查找算是最简单的了,无论是有序的还是无序的都可以,只需要一个个对比即可,但其实效率很低。 顺序查找 动图演示 详细代码 // 顺序查找 public static boolean search(int[] arrray, int key) { for (in ...
分类:
编程语言 时间:
2020-07-18 13:34:27
阅读次数:
57