- 博客(13)
- 收藏
- 关注
原创 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
原创 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
原创 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
原创 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
原创 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
原创 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
原创 LintCode560:各位相加
public class Solution { /* * @param num: a non-negative integer * @return: one digit */ public int addDigits(int num) { // write your code here String numString
2017-11-16 13:08:11
180
原创 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
原创 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
原创 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
145
原创 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
298
原创 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
222
原创 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
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人