上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要: 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 紫色的雪 阅读(3431) 评论(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 紫色的雪 阅读(6608) 评论(1) 推荐(0)
摘要: 2.适配器原理 (1)适配器就是一个类, 实现了监听器接口, 所有抽象方法都重写了, 但是方法全是空的. (2)适配器类需要定义成抽象的,因为创建该类对象,调用空方法是没有意义的 (3)目的就是为了简化程序员的操作, 定义监听器时继承适配器, 只重写需要的方法即可. 阅读全文
posted @ 2019-04-12 14:52 紫色的雪 阅读(177) 评论(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 紫色的雪 阅读(235) 评论(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 紫色的雪 阅读(158) 评论(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 紫色的雪 阅读(112) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; import java.util.Stack; public class Solution { public boolean IsPopOrder(int [] pushA,int [] popA) { Stack stackA = new Stack(); int len = pu... 阅读全文
posted @ 2019-04-11 08:20 紫色的雪 阅读(190) 评论(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 紫色的雪 阅读(633) 评论(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 紫色的雪 阅读(263) 评论(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 紫色的雪 阅读(868) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页