摘要:
这个是O(n2)的排序的总结 /* bubble sort */public static void sortIntegers(int[] A) { // Write your code here int len = A.length; if (len == 0) return; for (int
阅读全文
posted @ 2016-12-24 00:21
wenchan
阅读(249)
推荐(0)
摘要:
// Ref: https://segmentfault.com/a/1190000003811581// Ref: http://www.cnblogs.com/grandyang/p/4383632.html /*如果选择了抢劫上一个屋子,那么就不能抢劫当前的屋子,所以最大收益就是抢劫上一个屋子
阅读全文
posted @ 2016-12-22 00:38
wenchan
阅读(223)
推荐(0)
摘要:
这道题参考了这个网址: http://blog.csdn.net/u012490475/article/details/48845683 /* 首先考虑边界情况,当有1层时,有一种方法。 然后再看2层时,有1+1、和2+0,两种方法。 再看3层时,首先有两种选择:走一步或者走两步。 如果走两步,那后
阅读全文
posted @ 2016-12-20 00:56
wenchan
阅读(231)
推荐(0)
摘要:
/* 1st method will lead to time limit *//* the time complexity is exponential sicne T(n) = T(n-1) + T(n-2) */ /* 2nd method will need O(n) space, usin
阅读全文
posted @ 2016-12-19 01:04
wenchan
阅读(375)
推荐(0)
摘要:
这道题并不能显示出Python的强大,仅仅作为练手吧
阅读全文
posted @ 2016-08-18 21:45
wenchan
阅读(115)
推荐(0)
摘要:
1. 最近在练习Python,发现它的确有时候比较方便,比如这个,一行代码就解决了问题。 注意到里面这个这个方法。This is extended slice syntax. It works by doing [begin:end:step] - by leaving begin and end
阅读全文
posted @ 2016-08-17 23:15
wenchan
阅读(221)
推荐(0)
摘要:
This problem is a little confusing to me at first. But after I read some articles online, I got to know that it requires bitwise operations. So basica
阅读全文
posted @ 2016-08-08 22:40
wenchan
阅读(333)
推荐(0)
摘要:
3. Create PHP 1) “Sublime Text” is used as text editor. 2) HTML part of “hello.php” was created as shown. This file is under the directory of “\xampp\
阅读全文
posted @ 2016-03-09 11:12
wenchan
阅读(247)
推荐(0)
摘要:
2. Implementation of MySQL database in “phpMyAdmin” 1) Create database named “tbl_book” 2) I changed the “isbn” type to “bigint(50)” and “year” to “ye
阅读全文
posted @ 2016-03-09 10:56
wenchan
阅读(114)
推荐(0)
摘要:
这是学校的一个project,记录在这里,以备复习。主要是用XAMPP通过phpMyAdmin连接MySQL数据库,实现一个简单的查询功能。 Outline Setup of XAMPP Implementation of MySQL database in “phpMyAdmin” Create
阅读全文
posted @ 2016-03-08 00:51
wenchan
阅读(273)
推荐(0)