
LINTCODE
文章平均质量分 63
咕咕的鱼
这个作者很懒,什么都没留下…
展开
-
LintCode第697题目:判断是否为平方数之和
使用暴力查找的时候会超时,暴力查找算法:public class Solution { /* * @param : the given number * @return: whether whether there're two integers */ public boolean checkSumOfSquareNumbers(int num) {原创 2017-11-11 17:50:49 · 387 阅读 · 0 评论 -
LintCode372: 在O(1)时间复杂度删除链表节点
/** * Definition for ListNode. * public class ListNode { * int val; * ListNode next; * ListNode(int val) { * this.val = val; * this.next = null; * } * } */原创 2017-11-16 21:14:38 · 178 阅读 · 0 评论 -
LintCode 55. 比较字符串
比较两个字符串A和B,确定A中是否包含B中所有的字符。字符串A和B中的字符都是 大写字母在 A 中出现的 B 字符串里的字符不需要连续或者有序。样例给出 A = "ABCD" B = "ACD",返回 true给出 A = "ABCD" B = "AABC", 返回 falsepublic class Solution { /* * @param A: A strin原创 2017-11-16 20:06:30 · 181 阅读 · 0 评论 -
Lintcode 111. 爬楼梯
public class Solution { /** * @param n: An integer * @return: An integer */ public int climbStairs(int n) { // write your code here if(n==1){ return原创 2017-11-16 19:52:54 · 166 阅读 · 0 评论 -
LINTCODE69 :二叉树的层次遍历
/* @Copyright:LintCode @Author: cindyyao @Problem: http://www.lintcode.com/problem/binary-tree-level-order-traversal @Language: Java @Datetime: 17-03-14 04:49 */原创 2017-11-16 16:56:40 · 160 阅读 · 0 评论 -
LINTCODE93:平衡二叉树
/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val; * this.left =原创 2017-11-16 16:07:49 · 231 阅读 · 0 评论 -
LintCode167:链表求和
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } */原创 2017-11-14 00:22:53 · 254 阅读 · 0 评论 -
LintCode378:将二叉查找树转化成双链表
将一个二叉查找树按照中序遍历转换成双向链表/** * Definition of TreeNode: * public class TreeNode { * public int val; * public TreeNode left, right; * public TreeNode(int val) { * this.val = val;原创 2017-11-13 13:00:20 · 451 阅读 · 0 评论 -
lintCode:反转链表
/** * Definition for ListNode. * public class ListNode { * int val; * ListNode next; * ListNode(int val) { * this.val = val; * this.next = null; * } * } *//原创 2017-11-12 22:24:31 · 146 阅读 · 0 评论 -
lintCode655:大整数相加
public class Solution { /* * @param num1: a non-negative integers * @param num2: a non-negative integers * @return: return sum of num1 and num2 */ public String addStrings原创 2017-11-12 20:22:36 · 300 阅读 · 0 评论 -
lintCode627:最长回文串
public class Solution { /* * @param s: a string which consists of lowercase or uppercase letters * @return: the length of the longest palindromes that can be built */ public int原创 2017-11-11 22:33:55 · 223 阅读 · 0 评论 -
LintCode6. 合并排序数组
public class Solution { /* * @param A: sorted integer array A * @param B: sorted integer array B * @return: A new sorted integer array */ public int[] mergeSortedArray(int[原创 2017-12-02 11:50:27 · 163 阅读 · 0 评论