上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页
摘要: 【题目】Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a functio... 阅读全文
posted @ 2015-04-21 15:04 hwu_harry 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 【题目】Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3, You should return the following ... 阅读全文
posted @ 2015-04-21 14:30 hwu_harry 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 【题目】Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, ... 阅读全文
posted @ 2015-04-21 14:16 hwu_harry 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 一.有序数组的折半查找【步骤】① low=0,high=length-1; //初始值② 当low>high时,返回查找失败信息③ lowa[mid],low=mid+1; //查找在右半区 c.若key=a[mid],返回mid //查找成功【算法实现】public int bi... 阅读全文
posted @ 2015-04-20 20:54 hwu_harry 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 在项目中使用到了Timer,需要定时地执行某些功能。import java.util.Timer;import java.util.TimerTask;public class TestTimer { public static void main(String[] args) { ... 阅读全文
posted @ 2015-04-20 19:47 hwu_harry 阅读(129) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 下一页