摘要:
题目Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析Note中提示让用对数的时间复杂度求解,那么如果粗... 阅读全文
摘要:
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 num... 阅读全文
摘要:
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
摘要:
Description:Count the number of prime numbers less than a non-negative number,nclick to show more hints.Credits:Special thanks to@mithmattfor adding t... 阅读全文
摘要:
快速排序,只要学习过编程的人肯定都听说过这个名词,但是有时候写的时候还真蒙住了,网上搜罗了下以及查阅了"introduction to algorithm",暂时找到两种实现快排的方式,记录如下:1.通过挖坑,分治的方式,需要左右交替遍历思想如下:代码实现: 1 public static ... 阅读全文
摘要:
题目:House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constra... 阅读全文