topk问题是一个十分经典的问题,解决该问题主要有两种思路。 第一种是利用 堆 结构,讲解:https://www.cnblogs.com/chengxiao/p/6129630.html 第二种是利用 快速排序 先回顾一下实现堆结构的代码: package LCtest.com; import j ...
分类:
其他好文 时间:
2020-06-05 00:54:50
阅读次数:
54
Given a m * n matrix mat and an integer K, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for i - K <= r <= i + K ...
分类:
其他好文 时间:
2020-06-04 23:16:41
阅读次数:
110
手写容器 1、不使用类型参数的容器类 1.1、设计 Container 类 创建 Container 类并声明相关的 实例变量 : public class Container { private Object[] elements ; private int counter ; private f ...
分类:
编程语言 时间:
2020-06-04 21:34:53
阅读次数:
96
解决方法: name的命名不要使用html的标签元素即可 <script> export default { name:'button' // 不要使用内置或保留的HTML元素 , 改为Button或者置或保留的HTML元素之外的名称就好了 // 可以把button改为button1等都可以 } < ...
分类:
Web程序 时间:
2020-06-03 13:34:10
阅读次数:
133
Java Program to Find Largest Element of an array In this program, you'll learn to find the largest element in an array using a for loop in Java. Examp ...
分类:
其他好文 时间:
2020-06-03 00:32:38
阅读次数:
55
在vue.js中写新的components的时候,如果在新页面中的模板中设置height:100%的时候一直无效。 App.vue文件 <template> <div id="app"> <router-view/> </div> </template> <script> export defaul ...
分类:
其他好文 时间:
2020-06-01 21:05:22
阅读次数:
116
1.邮箱 export const isEmail = (s) => { return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) } 2.手机号码 export const isMobile = ...
分类:
其他好文 时间:
2020-05-31 18:18:32
阅读次数:
116
题目如下: Given an array of integers nums, you start with an initial positive value startValue. In each iteration, you calculate the step by step sum of s ...
分类:
其他好文 时间:
2020-05-29 09:26:12
阅读次数:
59
1.首先你要安装selenium库啦 pip install selenium 2.selenium查找元素就八种方法 from selenium import webdriver driver=webdriver.Chrome() #说明find_elements_by 多了一个s,返回的就是一个 ...
分类:
其他好文 时间:
2020-05-28 21:41:12
阅读次数:
304
Dom DOM基础 文档对象模型 Element attribute text 获取元素节点 older forms links achors images 表单,写表单name,尽量写 表单元素 document.[formName] 表单字段(域) formElement.[formFieled ...
分类:
Web程序 时间:
2020-05-26 20:39:23
阅读次数:
87