06 2015 档案

摘要:Given 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","7"]. 1 class ... 阅读全文
posted @ 2015-06-27 18:39 huj690 阅读(157) 评论(0) 推荐(0)
摘要:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired bythis... 阅读全文
posted @ 2015-06-13 21:31 huj690 阅读(199) 评论(0) 推荐(0)
摘要:Given an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the d... 阅读全文
posted @ 2015-06-08 23:37 huj690 阅读(143) 评论(0) 推荐(0)
摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-06-08 23:27 huj690 阅读(143) 评论(0) 推荐(0)
摘要:Reverse a singly linked list.思路:to slove this problem, I choose a recurrent method, to reverse linked-list nodes one-by-one.first, point head to NULL.... 阅读全文
posted @ 2015-06-08 23:21 huj690 阅读(306) 评论(0) 推荐(0)
摘要:Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-06-08 22:16 huj690 阅读(148) 评论(0) 推荐(0)
摘要:Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, except... 阅读全文
posted @ 2015-06-08 21:30 huj690 阅读(334) 评论(0) 推荐(0)
摘要:Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as shown ... 阅读全文
posted @ 2015-06-08 15:16 huj690 阅读(339) 评论(0) 推荐(0)