- 博客(20)
- 资源 (1)
- 收藏
- 关注
原创 LeetCode 2.两数相加
public static ListNode addTwoNumbers(ListNode l1, ListNode l2) { int j=0,temp=0,u; ListNode result=null,now=null; while(l1!=null||l2!=null){ System.out.println("j"+j); Sys...
2018-08-07 12:29:21
203
原创 lintcode 35. 翻转链表
/** * Definition for ListNode. * public class ListNode { * int val; * ListNode next; * ListNode(int val) { * this.val = val; * this.next = null; * } * } */public class ...
2018-03-01 11:25:34
263
原创 lintcode 搜索二维矩阵
public class Solution { /* * @param matrix: matrix, a list of lists of integers * @param target: An integer * @return: a boolean, indicate whether matrix contains target *
2018-01-26 20:55:54
232
原创 lintcode 平面列表
public class Solution { // @param nestedList a list of NestedInteger // @return a list of integer public List flatten(List nestedList) { List list=new ArrayList();
2018-01-26 20:26:08
276
原创 lintcode 二分查找
class Solution { /** * @param nums: The integer array. * @param target: Target to find. * @return: The first position of target. Position starts from 0. */ public int
2018-01-26 17:39:11
209
原创 lintcode 字符串查找
public class Solution { /* * @param source: source string to be scanned. * @param target: target string containing the sequence of characters to match * @return: a index to the
2018-01-26 17:05:20
196
原创 lintcode fizz buzz问题
public class Solution { /* * @param n: An integer * @return: A list of strings. */ public List fizzBuzz(int n) { List list=new ArrayList(); for(int i=1;i
2018-01-26 16:41:50
355
原创 lintcode 旋转字符串
public class Solution { /* * @param str: An array of char * @param offset: An integer * @return: nothing */ public void rotateString(char[] str, int offset) {
2018-01-26 16:32:55
213
原创 lintcode 合并排列数组 II
public class Solution { /* * @param A: sorted integer array A * @param B: sorted integer array B * @return: A new sorted integer array */ public int[] mergeSortedArra
2018-01-26 15:59:01
192
转载 lintcode A+B
利用位运算来解决A+B的问题,可以将此问题转化为解决不进位相加和进位(carry bit)的两部分问题:1. 首先是不进位相加:x = A^B 先对A和B进行异或运算(XOR manupitation) , A 和B 中两位不相同的变为1,相同的变为 0, 同为1是不进位2. 其次是进位 y =(A&B)所以 A+B = A^B + (A&B)3.在循环中(A&B
2018-01-25 23:08:18
301
原创 lintcode 二叉树遍历
/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val; * this
2018-01-22 19:09:54
209
原创 lintcode 删除链表中的元素
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */public class Solution { /*
2018-01-22 15:50:53
234
原创 lintcode 斐波纳契数列
public class Solution { /* * @param n: an integer * @return: an ineger f(n) */ public int fibonacci(int n) { if(n==1){ return 0; }else if(n==
2018-01-22 15:09:34
171
原创 org.apache.taglibs.standard.tlv.JstlCoreTLV.类无法找到
当standard包导入后确任然无法找到org.apache.taglibs.standard.tlv.JstlCoreTLV时可以将standard包放到tomcat的lib文件夹下
2018-01-03 18:43:04
2058
原创 ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [S
web项目部署到tomcat出现错误 ContainerBase.addChild: start: org.apache.catalina.LifecycleException:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ShowOrder]]
2017-11-26 10:13:10
23637
原创 jstl 报错 According to TLD or attribute directive in tag file, attribute test does not accept any expr
jstl 报错 According to TLD or attribute directive in tag file, attribute test does not accept any expressions将jsp头文件的 改为
2017-10-11 21:14:49
304
原创 jstl配置 c.tld not found
使用jstl标签报错JSTL异常:File "/WEB-INF/c.tld" not found将web.xml中的http://java.sun.com/jstl/core改为/tags/c
2017-10-11 20:38:39
1164
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅