摘要: 题目描述: Given a positive integer num, write a function which returns True if num is a perfect square else False. 解题分析: 这种找数字的题一般都用类似与二分查找的算法。需要注意的是比较平方和 阅读全文
posted @ 2016-06-28 00:12 godlei 阅读(295) 评论(0) 推荐(0)
摘要: 项目中的两个Controller层实现类,一个是跳转到jsp页面,一个是以Json形式返回Map键值对。 跳转到jsp页面: 一个是以Json形式返回Map键值对: 阅读全文
posted @ 2016-06-24 22:43 godlei 阅读(8032) 评论(0) 推荐(0)
摘要: 截取自项目中的一个service实现类,记录一下: base类 具体业务的实现类: 阅读全文
posted @ 2016-06-24 18:18 godlei 阅读(12564) 评论(1) 推荐(0)
摘要: 记录下一个Entity类的写法,方便以后查阅: 阅读全文
posted @ 2016-06-24 18:04 godlei 阅读(2584) 评论(0) 推荐(0)
摘要: 记录下一个dao层类的写法,方便以后的使用。 阅读全文
posted @ 2016-06-24 17:59 godlei 阅读(1357) 评论(0) 推荐(0)
摘要: 题目描述: You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it i 阅读全文
posted @ 2016-06-24 17:53 godlei 阅读(1593) 评论(0) 推荐(0)
摘要: 题目描述: Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. 解题思路: 阅读全文
posted @ 2016-06-24 17:23 godlei 阅读(1397) 评论(0) 推荐(0)
摘要: 题目描述: Given a roman numeral, convert it to an integer. 解题思路: 罗马计数法有以下规则: 基本数字 Ⅰ、X 、C 中的任何一个、自身连用构成数目、或者放在大数的右边连用构成数目、都不能超过三个;放在大数的左边只能用一个; 不能把基本数字 V 、 阅读全文
posted @ 2016-06-14 01:52 godlei 阅读(186) 评论(0) 推荐(0)
摘要: 题目描述: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 解题思路: 注意到用例比较少,所以采用以空间换时间的方法,把所有的结果列 阅读全文
posted @ 2016-06-14 01:44 godlei 阅读(318) 评论(0) 推荐(0)
摘要: 题目描述: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two 阅读全文
posted @ 2016-06-14 01:40 godlei 阅读(466) 评论(0) 推荐(0)