随笔分类 -  LintCode

摘要:第一种方法,用tree树排序,每次都排序import java.util.LinkedList;import java.util.TreeSet;public class MinStack1 { /** * 带最小值操作的栈 * 实现一个带有取最... 阅读全文
posted @ 2018-08-08 01:19 wei1 阅读(90) 评论(0) 推荐(0)
摘要:import org.junit.Test;import java.util.Arrays;public class MergeSort { /** * @param A: sorted integer array A * @param B: s... 阅读全文
posted @ 2018-08-07 23:05 wei1 阅读(84) 评论(0) 推荐(0)
摘要:import org.junit.Test;import java.util.*;public class KthLargestElement { /** * @param k : description of k * @param num... 阅读全文
posted @ 2018-08-07 23:04 wei1 阅读(80) 评论(0) 推荐(0)
摘要://答案来源//[https://blog.csdn.net/surp2011/article/details/51168272](https://blog.csdn.net/surp2011/article/details/51168272)/** * 描述 * 设... 阅读全文
posted @ 2018-08-07 23:02 wei1 阅读(98) 评论(0) 推荐(0)
摘要:import org.junit.Test;public class NthUglyNumber { /** * @param n: An integer * @return: the nth prime number as descriptio... 阅读全文
posted @ 2018-08-07 23:01 wei1 阅读(101) 评论(0) 推荐(0)
摘要:import org.junit.Test;import java.util.Arrays;import java.util.List;public class FizzBuzz { /** * @param n: An integer * @r... 阅读全文
posted @ 2018-08-07 23:00 wei1 阅读(123) 评论(0) 推荐(0)
摘要:import org.junit.Test;public class DigitCounts { /* * @param : An integer * @param : An integer * @return: An integer d... 阅读全文
posted @ 2018-08-07 22:59 wei1 阅读(98) 评论(0) 推荐(0)
摘要:public class BinarySearch { /** * @param nums: The integer array. * @param target: Target to find. * @return: The fir... 阅读全文
posted @ 2018-08-07 22:27 wei1 阅读(98) 评论(0) 推荐(0)
摘要:import org.junit.Test;public class AplusB { /** * @param a: An integer * @param b: An integer * @return: The sum of a a... 阅读全文
posted @ 2018-08-07 22:26 wei1 阅读(177) 评论(0) 推荐(0)
摘要:package dp;import org.junit.Test;public class NumWays { /** * @param n: non-negative integer, n posts * @param k: non-negat... 阅读全文
posted @ 2018-08-07 22:25 wei1 阅读(126) 评论(0) 推荐(0)
摘要:import org.junit.Test;public class IsInterleave { /** * @param s1: A string * @param s2: A string * @param s3: A string... 阅读全文
posted @ 2018-08-07 21:47 wei1 阅读(114) 评论(0) 推荐(0)