08 2018 档案

摘要:import org.junit.Test;import java.util.Arrays;public class SearchMatrix { /** * @param matrix: matrix, a list of lists of integ... 阅读全文
posted @ 2018-08-28 17:30 wei1 阅读(93) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;public class Reverse { /** * @param head: n * @return: The new head of reversed linked list. * ... 阅读全文
posted @ 2018-08-28 00:57 wei1 阅读(105) 评论(0) 推荐(0) 编辑
摘要:首先查找配置文件发现默认配置文件位置再 C:\ProgramData\MySQL\MySQL Server 5.7\my.ini 打开后修改以下内容: 当然发现重启后SHOW VARIABLES LIKE 'character%'; 查看mysql默认字符集还是没变化,很明显我们的配置文件没有被my 阅读全文
posted @ 2018-08-27 21:39 wei1 阅读(361) 评论(0) 推荐(0) 编辑
摘要:systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。启动一个服务:systemctl start firewalld.service关闭一个服务:systemctl stop firewalld.se... 阅读全文
posted @ 2018-08-27 15:11 wei1 阅读(121) 评论(0) 推荐(0) 编辑
摘要:原文地址:http://www.codes51.com/itwd/4517194.html问题: 关于阿里巴巴开发手册”不得使用外键与级联,一切外键概念必须在应用层解决”的疑惑 描述: 原文如下:【强制】不得使用外键与级联,一切外键概念必须在应用层解决。 说明:以... 阅读全文
posted @ 2018-08-24 02:26 wei1 阅读(2882) 评论(0) 推荐(0) 编辑
摘要:求棋盘的最短路径问题,BFS遍历,这题就是马跳日的为题,不难,倒是我把x,y轴搞反了浪费了良久的时间查看为什么数组越界import org.junit.Test;import java.util.LinkedList;class Point { int x; ... 阅读全文
posted @ 2018-08-23 00:22 wei1 阅读(184) 评论(0) 推荐(0) 编辑
摘要:这题简单是典型的bfs题,注意递归最后将本层节点的集合作为下一层的集合import org.junit.Test;import tree.TreeNode;import java.util.LinkedList;import java.util.List;public... 阅读全文
posted @ 2018-08-22 22:45 wei1 阅读(106) 评论(0) 推荐(0) 编辑
摘要:在网上找了很多都不是我要的答案,我的配置都是对的,就是不能连接外网,查看了一下打开右上角我圈的地方编辑网卡,发现使用的网关尽然不是我配置的网关,改为我配置的网关后再 service network restart 就可以了终于可以连接外网了,突然发现不能连接内网了,s... 阅读全文
posted @ 2018-08-19 14:20 wei1 阅读(315) 评论(0) 推荐(0) 编辑
摘要:这题反正一看就是和快排的nlogn中的一次n,使用两个指针,要注意的就是考虑各种边界条件,从数组的右边开始,遇到==k的值也往下搜索,而从数组左边开始的指针遇到k值不往上搜索,这样的话就可以控制如果出现重复k值的情况,的到的结果是最先出现的坐标,如果题目要求得到最右边... 阅读全文
posted @ 2018-08-16 15:07 wei1 阅读(162) 评论(0) 推荐(0) 编辑
摘要:使用码云或者github创建项目的时候现在都会自动生成.gitignore文件,一定要注意先pull –rebase origin master 下来后在git add,也就是说先把.gitignore文件同步到本地中,在git add,否则.gitignore 文件... 阅读全文
posted @ 2018-08-15 23:33 wei1 阅读(1641) 评论(0) 推荐(0) 编辑
摘要:参考:https://stackoverflow.com/questions/24114676/git-error-failed-to-push-some-refs-to在码云新建了一个项目后生成有readme.md文件在push本地项目是出现一下错误$ git ... 阅读全文
posted @ 2018-08-15 23:04 wei1 阅读(469) 评论(0) 推荐(0) 编辑
摘要:比不重复的多了一段代码,if (i!=startIndex&&nums[i]==nums[i-1]){ continue; }有点难懂,记一下import org.junit.Test;import java.u... 阅读全文
posted @ 2018-08-15 01:19 wei1 阅读(182) 评论(0) 推荐(0) 编辑
摘要:subsets这题非递归的写法很好写,递归DFS我一直没想到递归的退出条件,没想到是没有,运行完了自动退出,return;再末尾,和partition得到字符串字串类似的通过控制startIndex控制循环从而得到从数组startIndex开始的子串import or... 阅读全文
posted @ 2018-08-14 21:01 wei1 阅读(104) 评论(0) 推荐(0) 编辑
摘要:基于Hibernate customer order表1.一个order中有一个customer单项多对一(n-1)先保存一再保存多,因为这样再保存多的时候外键值已经确定,这时候时多的一方维护外键,再保存order时会带着保存外键的customerID,可以不用在up... 阅读全文
posted @ 2018-08-13 15:47 wei1 阅读(99) 评论(0) 推荐(0) 编辑
摘要:hibernate程序的异常:java.lang.UnsupportedOperationException: The user must supply a JDBC connection在使用JPA时请注意,Hibernate 3.x和4.x具有不同的语法,如下所述... 阅读全文
posted @ 2018-08-12 21:16 wei1 阅读(489) 评论(0) 推荐(0) 编辑
摘要:使用的是1.1.10版本,使用时出现Property: spring.datasource.filters错误去掉log4j后还可以使用,发现时新版本的Druid配置改变了Property: spring.datasource.filters Value: s... 阅读全文
posted @ 2018-08-12 02:16 wei1 阅读(1320) 评论(0) 推荐(0) 编辑
摘要:这个DFS也很特殊,答案很有感觉import org.junit.Test;import java.util.ArrayList;import java.util.List;public class Partition { /** * @param s:... 阅读全文
posted @ 2018-08-09 23:33 wei1 阅读(150) 评论(0) 推荐(0) 编辑
摘要:这题有点难,看了九章的DFS答案,感觉写的很妙啊,就是运行的有点慢,这题学到了不一样的DFS color判断 关于拓扑排序的介绍:https://blog.csdn.net/qq_35644234/article/details/60578189import gra... 阅读全文
posted @ 2018-08-09 22:24 wei1 阅读(171) 评论(0) 推荐(0) 编辑
摘要:这题需要考虑什么是最小深度,根节点到最近叶子节点的距离,为了防止一个子树为null的情况干扰后续的 Math.min(dfsMinDepth(root.left), dfsMinDepth(root.right))运算,将 if (root == nul... 阅读全文
posted @ 2018-08-09 02:08 wei1 阅读(109) 评论(0) 推荐(0) 编辑
摘要:FS类题目,果然题目都是靠刷的,这个题目和全排列差不多,自己很快就一套撸出了,主要的细节就是添加一个beginNum变量方便控制重复的例如[1,4][4,1]等重复答案,具体可以参照我的代码import org.junit.Test;import java.util.... 阅读全文
posted @ 2018-08-09 01:30 wei1 阅读(221) 评论(0) 推荐(0) 编辑
摘要:DFS题,这个代码几乎是看的九章的答案,写的是真的好,个个变量函数的命名确实有感觉,用一个List同时表示行和列非常巧妙import org.junit.Test;import java.util.ArrayList;import java.util.List;pub... 阅读全文
posted @ 2018-08-09 00:25 wei1 阅读(117) 评论(0) 推荐(0) 编辑
摘要:写在前面:这题和全排列不含重复元素的那题几乎一样,我比较垃圾,就用HashSet去掉了重复的元素但是看了九章算法的答案也没看懂,他写的很有感觉。用了hash,本来想着怎么写hashcode()和equal()方法的,哪知道都帮我写好了,Integer类型的元素存储在L... 阅读全文
posted @ 2018-08-08 16:47 wei1 阅读(184) 评论(0) 推荐(0) 编辑
摘要:学习了怎么写简单的递归DPS,没有去琢磨非递归import org.junit.Test;import java.util.ArrayList;import java.util.List;public class Permute { /** * @par... 阅读全文
posted @ 2018-08-08 15:06 wei1 阅读(82) 评论(0) 推荐(0) 编辑
摘要:TreeNodepublic class TreeNode { public int val; public TreeNode left, right; public TreeNode(int val) { this.val = val... 阅读全文
posted @ 2018-08-08 15:03 wei1 阅读(79) 评论(0) 推荐(0) 编辑
摘要:import java.util.ArrayList;import java.util.List;public class SearchRange { /** * 11. Search Range in Binary Search Tree * ... 阅读全文
posted @ 2018-08-08 15:00 wei1 阅读(73) 评论(0) 推荐(0) 编辑
摘要:public class StrStr { /** * @param source: source string to be scanned. * @param target: target string containing the seque... 阅读全文
posted @ 2018-08-08 14:58 wei1 阅读(102) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;import java.util.Arrays;public class RotateString { /** * @param str: An array of char * @param offse... 阅读全文
posted @ 2018-08-08 14:55 wei1 阅读(101) 评论(0) 推荐(0) 编辑
摘要:第一种方法,用tree树排序,每次都排序import java.util.LinkedList;import java.util.TreeSet;public class MinStack1 { /** * 带最小值操作的栈 * 实现一个带有取最... 阅读全文
posted @ 2018-08-08 01:19 wei1 阅读(86) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;import java.util.Arrays;public class MergeSort { /** * @param A: sorted integer array A * @param B: s... 阅读全文
posted @ 2018-08-07 23:05 wei1 阅读(78) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;import java.util.*;public class KthLargestElement { /** * @param k : description of k * @param num... 阅读全文
posted @ 2018-08-07 23:04 wei1 阅读(77) 评论(0) 推荐(0) 编辑
摘要://答案来源//[https://blog.csdn.net/surp2011/article/details/51168272](https://blog.csdn.net/surp2011/article/details/51168272)/** * 描述 * 设... 阅读全文
posted @ 2018-08-07 23:02 wei1 阅读(94) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;public class NthUglyNumber { /** * @param n: An integer * @return: the nth prime number as descriptio... 阅读全文
posted @ 2018-08-07 23:01 wei1 阅读(97) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;import java.util.Arrays;import java.util.List;public class FizzBuzz { /** * @param n: An integer * @r... 阅读全文
posted @ 2018-08-07 23:00 wei1 阅读(115) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;public class DigitCounts { /* * @param : An integer * @param : An integer * @return: An integer d... 阅读全文
posted @ 2018-08-07 22:59 wei1 阅读(92) 评论(0) 推荐(0) 编辑
摘要:public class BinarySearch { /** * @param nums: The integer array. * @param target: Target to find. * @return: The fir... 阅读全文
posted @ 2018-08-07 22:27 wei1 阅读(89) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;public class AplusB { /** * @param a: An integer * @param b: An integer * @return: The sum of a a... 阅读全文
posted @ 2018-08-07 22:26 wei1 阅读(159) 评论(0) 推荐(0) 编辑
摘要:package dp;import org.junit.Test;public class NumWays { /** * @param n: non-negative integer, n posts * @param k: non-negat... 阅读全文
posted @ 2018-08-07 22:25 wei1 阅读(121) 评论(0) 推荐(0) 编辑
摘要:import org.junit.Test;public class IsInterleave { /** * @param s1: A string * @param s2: A string * @param s3: A string... 阅读全文
posted @ 2018-08-07 21:47 wei1 阅读(111) 评论(0) 推荐(0) 编辑
摘要:转自:https://www.cnblogs.com/llguanli/p/7363657.html二叉树是一种非常重要的数据结构,非常多其他数据结构都是基于二叉树的基础演变而来的。对于二叉树,有深度遍历和广度遍历,深度遍历有前序、中序以及后序三种遍历方法,广度遍... 阅读全文
posted @ 2018-08-06 21:59 wei1 阅读(331) 评论(0) 推荐(0) 编辑
摘要:路径为相对路径,在转发后以servlet的路径为依据找不到文件,使用绝对路径就是以项目名开头的路径thymeleaf中使用 th:src="@{/asserts/img/bootstrap-solid.svg}" 以/开头解析后默认添加了项目的项目名 jsp文件使用 ... 阅读全文
posted @ 2018-08-05 22:12 wei1 阅读(257) 评论(0) 推荐(0) 编辑
摘要:使用thymeleaf模板的时候,跳转页面的时候老是不成功。目标是让跳转到success.html页面。但是结果页面老是返回sucess。而不是跳转到index.html页面。找了半天差错,发现是注解使用的是@RestController 应该使用@Controll... 阅读全文
posted @ 2018-08-03 01:29 wei1 阅读(201) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示