![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
qq_39060375
这个作者很懒,什么都没留下…
展开
-
Lintcode81Data Stream Mediansolution题解
【题目描述】Numbers keep coming, return the median of numbers at every time a new number added.数字是不断进入数组的,在每次添加一个新的数进入数组的同时返回当前新数组的中位数。【说明】:中位数的定义:中位数是排序后数组的中间值,如果有数组中有n个数,则中位数为A[(n-1)/2]。比如转载 2017-06-29 10:13:29 · 162 阅读 · 0 评论 -
Lintcode78 Longest Common On Prefix solution 题解
【题目描述】Given k strings, find the longest common prefix (LCP).给k个字符串,求出他们的最长公共前缀(LCP)【题目链接】www.lintcode.com/en/problem/longest-common-prefix/【题目解析】解题思路是:先对整个String数组预处理一下,求一个转载 2017-06-28 15:38:58 · 140 阅读 · 0 评论 -
Lintcode86 Binary Search Tree Iteratorsolution 题解
【题目描述】Design an iterator over a binary search tree with the following rules:·Elements are visited in ascending order (i.e. an in-order traversal)·next()andhasNext()queries run in O(1转载 2017-07-06 15:01:05 · 229 阅读 · 0 评论 -
Lintcode77 Longest Common Subsequence solution 题解
【题目描述】Given two strings, find the longest common subsequence (LCS).Your code should return the length ofLCS.给出两个字符串,找到最长公共子序列(LCS),返回LCS的长度。【题目链接】www.lintcode.com/en/problem/longest-common转载 2017-06-27 13:35:39 · 213 阅读 · 0 评论 -
Lintcode84 Single Number |||solution 题解
【题目描述】Given2*n + 2numbers, every numbers occurs twice except two, find them.给出2*n + 2个的数字,除其中两个数字之外其他每个数字均出现两次,找到这两个数字。【题目链接】www.lintcode.com/en/problem/single-number-iii/【题目转载 2017-07-04 14:14:26 · 218 阅读 · 0 评论 -
Lintcode76 Longest Increasing Subsequence solution 题解
【题目描述】Given a sequence of integers, find the longest increasing subsequence (LIS).You code should return the length of the LIS.给定一个整数序列,找到最长上升子序列(LIS),返回LIS的长度。【说明】:最长上升子序列的定义:最长转载 2017-06-26 10:21:50 · 252 阅读 · 0 评论 -
Lintcode85 Insert Node In A Binary Search Tree solution 题解
【题目描述】Given a binary search tree and a new tree node, insert the node into the tree. You should keep the tree still be a valid binary search tree.给定一棵二叉查找树和一个新的树节点,将节点插入到树中。你需要保证该树仍然转载 2017-07-05 09:53:15 · 245 阅读 · 0 评论 -
Lintcode83 Single Number ||solution 题解
【题目描述】Given3*n + 1numbers, every numbers occurs triple times except one, find it.给出3*n + 1 个的数字,除其中一个数字之外其他每个数字均出现三次,找到这个数字。【题目链接】www.lintcode.com/en/problem/single-number-ii/【题目解析】这题给转载 2017-07-03 16:16:58 · 260 阅读 · 0 评论 -
Lintcode82 Single Number solution题解
【题目描述】Given2*n + 1numbers, every numbers occurs twice except one, find it.给出2*n + 1 个的数字,除其中一个数字之外其他每个数字均出现两次,找到这个数字。【题目链接】www.lintcode.com/en/problem/single-number/【题目解析】转载 2017-06-30 09:32:07 · 245 阅读 · 0 评论 -
Lintcode87 Remove Node In Binary Search Treesolution 题解
【题目描述】Design an iterator over a binary search tree with the following rules:·Elements are visited in ascending order (i.e. an in-order traversal)·next()andhasNext()queries run in O(1转载 2017-07-07 14:20:54 · 203 阅读 · 0 评论