上一页 1 2 3 4 5 6 7 8 9 ··· 24 下一页
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
posted @ 2015-09-20 16:39 丶Blank 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to... 阅读全文
posted @ 2015-09-17 21:09 丶Blank 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.计算N皇后的合法解的数量。解题思路:这次使用了更优化的... 阅读全文
posted @ 2015-09-16 15:46 丶Blank 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl... 阅读全文
posted @ 2015-09-16 15:42 丶Blank 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 公司在推一个大项目,感觉阿里云挺好用的,自己搞了台小机器平时可以跑着玩,而且可以做个跳板机,平时学校里的收费网直接用跳板机就可以访问了,直接写个脚本在自己机器上跑一下:#!/usr/bin/expect -fset timeout -1spawn ssh -qTNf -D 127.0.0.1:123... 阅读全文
posted @ 2015-09-14 16:07 丶Blank 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].题目大意:给定一个组区间,实... 阅读全文
posted @ 2015-09-11 18:46 丶Blank 阅读(158) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c... 阅读全文
posted @ 2015-09-11 16:21 丶Blank 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According ... 阅读全文
posted @ 2015-09-11 16:15 丶Blank 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1, 3]retur... 阅读全文
posted @ 2015-09-11 16:09 丶Blank 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 蓄水池算法要解决的问题就是在不知道流入数据量多少的情况下,依旧可以随机从这些数中选取K个,乍一听好神奇,其实分析一下背后的概率知识,思想还是很简单的,相信看完我的介绍和证明,你也会觉得很简单。假设要求随机选择K个元素,假设一共流入的元素有n个。 首先数组a[0...k-1]表示最后返回的结果,最开... 阅读全文
posted @ 2015-09-11 14:37 丶Blank 阅读(1210) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 24 下一页