12 2015 档案

摘要:题目:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum... 阅读全文
posted @ 2015-12-24 20:04 zhangbaochong 阅读(198) 评论(0) 推荐(0) 编辑
摘要:问题:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2... 阅读全文
posted @ 2015-12-22 22:30 zhangbaochong 阅读(260) 评论(0) 推荐(0) 编辑
摘要:题目:Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed ... 阅读全文
posted @ 2015-12-21 23:23 zhangbaochong 阅读(196) 评论(0) 推荐(0) 编辑
摘要:题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't ... 阅读全文
posted @ 2015-12-20 20:04 zhangbaochong 阅读(237) 评论(0) 推荐(0) 编辑
摘要:题目:Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].S... 阅读全文
posted @ 2015-12-20 19:22 zhangbaochong 阅读(305) 评论(0) 推荐(0) 编辑
摘要:题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the ... 阅读全文
posted @ 2015-12-20 14:13 zhangbaochong 阅读(302) 评论(0) 推荐(0) 编辑
摘要:题目:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive inte... 阅读全文
posted @ 2015-12-19 20:52 zhangbaochong 阅读(528) 评论(0) 推荐(0) 编辑
摘要:题目:Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, giv... 阅读全文
posted @ 2015-12-19 20:34 zhangbaochong 阅读(670) 评论(0) 推荐(0) 编辑
摘要:题目:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complex... 阅读全文
posted @ 2015-12-18 22:00 zhangbaochong 阅读(228) 评论(0) 推荐(0) 编辑
摘要:题目:Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3... 阅读全文
posted @ 2015-12-17 16:14 zhangbaochong 阅读(547) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示