06 2015 档案

[LintCode] Find the Weak Connected Component in the Directed Graph
摘要:Find the Weak Connected Component in the Directed GraphFind the number Weak Connected Component in the directed graph. Each node in the graph contains... 阅读全文

posted @ 2015-06-29 13:34 Eason Liu 阅读(1436) 评论(0) 推荐(0)

[LeetCode] Majority Element II
摘要:Majority Element IIGiven an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and i... 阅读全文

posted @ 2015-06-29 10:44 Eason Liu 阅读(269) 评论(0) 推荐(0)

[LintCode] Find the Connected Component in the Undirected Graph
摘要:Find the Connected Component in the Undirected GraphFind the number connected component in the undirected graph. Each node in the graph contains a lab... 阅读全文

posted @ 2015-06-28 22:37 Eason Liu 阅读(1347) 评论(0) 推荐(1)

[hihoCoder] 第五十二周: 连通性·一
摘要:题目1 : 连通性·一时间限制:10000ms单点时限:1000ms内存限制:256MB描述还记得上次小Hi和小Ho学校被黑客攻击的事情么,那一次攻击最后造成了学校网络数据的丢失。为了避免再次出现这样的情况,学校决定对校园网络进行重新设计。学校现在一共拥有N台服务器(编号1..N)以及M条连接,保证... 阅读全文

posted @ 2015-06-27 22:34 Eason Liu 阅读(432) 评论(0) 推荐(0)

[LeetCode] Summary Ranges
摘要:Summary RangesGiven a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5",... 阅读全文

posted @ 2015-06-26 13:48 Eason Liu 阅读(651) 评论(0) 推荐(0)

[hihoCoder] 第五十周: 欧拉路·二
摘要:题目1 : 欧拉路·二时间限制:10000ms单点时限:1000ms内存限制:256MB描述在上一回中小Hi和小Ho控制着主角收集了分散在各个木桥上的道具,这些道具其实是一块一块骨牌。主角继续往前走,面前出现了一座石桥,石桥的尽头有一道火焰墙,似乎无法通过。小Hi注意到在桥头有一张小纸片,于是控制主... 阅读全文

posted @ 2015-06-21 20:30 Eason Liu 阅读(362) 评论(0) 推荐(0)

[LintCode] Longest Increasing Continuous subsequence II
摘要:Longest Increasing Continuous subsequence IIGive you an integer matrix (with row size n, column size m),find the longest increasing continuous subsequ... 阅读全文

posted @ 2015-06-18 17:27 Eason Liu 阅读(290) 评论(0) 推荐(0)

[LintCode] Maximum Subarray Difference
摘要:Maximum Subarray DifferenceGiven an array with integers.Find twonon-overlappingsubarrays A and B, which|SUM(A) - SUM(B)|is thelargest.Return the large... 阅读全文

posted @ 2015-06-17 15:17 Eason Liu 阅读(265) 评论(0) 推荐(0)

[HDU 3415] Max Sum of Max-K-sub-sequence
摘要:Max Sum of Max-K-sub-sequenceProblem DescriptionGiven a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is ... 阅读全文

posted @ 2015-06-17 11:12 Eason Liu 阅读(327) 评论(0) 推荐(0)

[LintCode] Count of Smaller Number before itself
摘要:Count of Smaller Number before itselfGive you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) . For e... 阅读全文

posted @ 2015-06-14 20:24 Eason Liu 阅读(1206) 评论(0) 推荐(0)

[LeetCode] Invert Binary Tree
摘要:Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem w... 阅读全文

posted @ 2015-06-12 15:57 Eason Liu 阅读(283) 评论(0) 推荐(0)

[LintCode] Max Tree
摘要:Max TreeGiven an integer array with no duplicates. A max tree building on this array is defined as follow:The root is the maximum number in the arrayT... 阅读全文

posted @ 2015-06-11 16:15 Eason Liu 阅读(1122) 评论(0) 推荐(0)

[LeetCode] Implement Stack using Queues
摘要:Implement Stack using QueuesImplement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the eleme... 阅读全文

posted @ 2015-06-11 11:12 Eason Liu 阅读(2100) 评论(1) 推荐(0)

[LintCode] Maximum Subarray III
摘要:Maximum Subarray IIIGiven an array of integers and a numberk, find knon-overlappingsubarrays which have the largest sum.The number in each subarray sh... 阅读全文

posted @ 2015-06-10 18:11 Eason Liu 阅读(1228) 评论(0) 推荐(0)

[LeetCode] Basic Calculator & Basic Calculator II
摘要:Basic CalculatorImplement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), t... 阅读全文

posted @ 2015-06-09 15:57 Eason Liu 阅读(4946) 评论(1) 推荐(1)

[LeetCode] Rectangle Area
摘要:Rectangle AreaFind the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right co... 阅读全文

posted @ 2015-06-08 12:30 Eason Liu 阅读(3559) 评论(1) 推荐(1)

[hihoCoder] 第四十九周: 欧拉路·一
摘要:题目1 : 欧拉路·一时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho最近在玩一个解密类的游戏,他们需要控制角色在一片原始丛林里面探险,收集道具,并找到最后的宝藏。现在他们控制的角色来到了一个很大的湖边。湖上有N个小岛(编号1..N),以及连接小岛的M座木桥。每座... 阅读全文

posted @ 2015-06-06 21:42 Eason Liu 阅读(850) 评论(0) 推荐(0)

[LeetCode] Count Complete Tree Nodes
摘要:Count Complete Tree NodesGiven acompletebinary tree, count the number of nodes.In a complete binary tree every level, except possibly the last, is com... 阅读全文

posted @ 2015-06-06 12:59 Eason Liu 阅读(2632) 评论(0) 推荐(0)

[LintCode] Minimum Adjustment Cost
摘要:Minimum Adjustment CostGiven an integer array, adjust each integers so that the difference of every adjacent integers are not greater than a given num... 阅读全文

posted @ 2015-06-03 12:55 Eason Liu 阅读(542) 评论(0) 推荐(1)

[LeetCode] Maximal Square
摘要:Maximal SquareGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the ... 阅读全文

posted @ 2015-06-03 12:01 Eason Liu 阅读(3068) 评论(2) 推荐(0)

[LeetCode] Contains Duplicate III
摘要:Contains Duplicate IIIGiven an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennum... 阅读全文

posted @ 2015-06-01 15:33 Eason Liu 阅读(6037) 评论(0) 推荐(0)

[LintCode] Subarray Sum & Subarray Sum II
摘要:Subarray SumGiven an integer array, find a subarray where the sum of numbers iszero. Your code should return the index of the first number and the ind... 阅读全文

posted @ 2015-06-01 12:21 Eason Liu 阅读(2414) 评论(0) 推荐(0)