04 2019 档案

摘要:public String convert(String s, int numRows) { if(numRows <= 1){ return s; } StringBuilder[] sb = new StringBuilder[numRows]; for(int i = 0; i < sb.length;... 阅读全文
posted @ 2019-04-27 11:17 紫色的雪 阅读(1380) 评论(0) 推荐(0)
摘要:public String longestPalindrome(String s) { if(s == null||s.length()==0){ return s; } String res = ""; int max=0; boolean[][] dp = new boolean[s.l... 阅读全文
posted @ 2019-04-24 23:12 紫色的雪 阅读(1339) 评论(0) 推荐(0)
摘要:public double findMedianSortedArrays(int[] nums1, int[] nums2) { if(nums1.length > nums2.length){ return findMedianSortedArrays(nums2, nums1); } int cut1=0; ... 阅读全文
posted @ 2019-04-24 11:18 紫色的雪 阅读(2604) 评论(0) 推荐(0)
摘要:public int lengthOfLongestSubstring(String s) { if(s.length()==0||s==null){ return 0; } int len=0; HashSet hashSet = new HashSet(); for(int i=0,j=0... 阅读全文
posted @ 2019-04-22 20:45 紫色的雪 阅读(833) 评论(0) 推荐(0)
摘要:/* public class RandomListNode { int label; RandomListNode next = null; RandomListNode random = null; RandomListNode(int label) { this.label = label; } } */ /** * 根据每个节点n... 阅读全文
posted @ 2019-04-21 16:45 紫色的雪 阅读(347) 评论(0) 推荐(0)
摘要:import java.util.ArrayList; import java.util.Stack; /** public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val ... 阅读全文
posted @ 2019-04-17 21:47 紫色的雪 阅读(522) 评论(0) 推荐(0)
摘要:public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode dummy = new ListNode(0); ListNode p1 = l1; ListNode p2 = l2; ListNode cur = dummy; int sum =... 阅读全文
posted @ 2019-04-15 19:43 紫色的雪 阅读(3436) 评论(0) 推荐(0)
摘要:class Solution { public int[] twoSum(int[] nums, int target) { if(nums == null || nums.length map = new HashMap(); for(int i = 0; i < nums.length; i++){ if(map.cont... 阅读全文
posted @ 2019-04-14 19:17 紫色的雪 阅读(6610) 评论(1) 推荐(0)
摘要:2.适配器原理 (1)适配器就是一个类, 实现了监听器接口, 所有抽象方法都重写了, 但是方法全是空的. (2)适配器类需要定义成抽象的,因为创建该类对象,调用空方法是没有意义的 (3)目的就是为了简化程序员的操作, 定义监听器时继承适配器, 只重写需要的方法即可. 阅读全文
posted @ 2019-04-12 14:52 紫色的雪 阅读(178) 评论(0) 推荐(0)
摘要:import java.util.Arrays; public class Solution { public boolean VerifySquenceOfBST(int [] sequence) { if(sequence.length==0 ){ return false; } if(sequ... 阅读全文
posted @ 2019-04-12 10:53 紫色的雪 阅读(237) 评论(0) 推荐(0)
摘要:/** * 构造方法 * 目标类 */ public class User { private int uid; private String username; private int age; public User(int uid, String username) { this.uid = 阅读全文
posted @ 2019-04-11 19:50 紫色的雪 阅读(163) 评论(0) 推荐(0)
摘要:import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; //即广度优先搜索树 public class Solution { public ArrayList PrintFromTopToBottom(TreeNode root) { ArrayLi... 阅读全文
posted @ 2019-04-11 10:05 紫色的雪 阅读(114) 评论(0) 推荐(0)
摘要:import java.util.Stack; import java.util.Iterator; public class Solution { Stack s = new Stack(); public void push(int node) { s.push(node); } public void pop() { s.pop(); } public int top() { ret... 阅读全文
posted @ 2019-04-10 16:40 紫色的雪 阅读(634) 评论(0) 推荐(0)
摘要:public ArrayList printMatrix(int [][] matrix) { int lenRows = matrix.length;//矩阵的行长 int lenColumn = matrix[0].length;//列长 ArrayList list = new ArrayList(); if(lenR... 阅读全文
posted @ 2019-04-10 09:33 紫色的雪 阅读(268) 评论(0) 推荐(0)
摘要:2019-04-07 19:29:22,204 WARN [org.springframework.context.support.ClassPathXmlApplicationContext] - Exception encountered during context initializatio 阅读全文
posted @ 2019-04-07 19:55 紫色的雪 阅读(873) 评论(0) 推荐(0)
摘要:http://repo.spring.io/libs-release-local/org/springframework/spring/ 阅读全文
posted @ 2019-04-04 14:40 紫色的雪 阅读(166) 评论(0) 推荐(0)
摘要:需要在web-inf的lib下导入如下的jar包 阅读全文
posted @ 2019-04-01 14:41 紫色的雪 阅读(3828) 评论(0) 推荐(0)