2016年12月24日

LintCode 463 Sort Integer

摘要: 这个是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) 推荐(0)
2016年12月22日

LintCode 392 House Robber

摘要: // Ref: https://segmentfault.com/a/1190000003811581// Ref: http://www.cnblogs.com/grandyang/p/4383632.html /*如果选择了抢劫上一个屋子,那么就不能抢劫当前的屋子,所以最大收益就是抢劫上一个屋子 阅读全文
posted @ 2016-12-22 00:38 wenchan 阅读(223) 评论(0) 推荐(0)
2016年12月20日

LintCode 111 Climbing Stairs

摘要: 这道题参考了这个网址: http://blog.csdn.net/u012490475/article/details/48845683 /* 首先考虑边界情况,当有1层时,有一种方法。 然后再看2层时,有1+1、和2+0,两种方法。 再看3层时,首先有两种选择:走一步或者走两步。 如果走两步,那后 阅读全文
posted @ 2016-12-20 00:56 wenchan 阅读(231) 评论(0) 推荐(0)
2016年12月19日

LintCode 366 Fibonacci

摘要: /* 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) 推荐(0)
2016年8月18日

LeetCode 292 Nim Game

摘要: 这道题并不能显示出Python的强大,仅仅作为练手吧 阅读全文
posted @ 2016-08-18 21:45 wenchan 阅读(115) 评论(0) 推荐(0)
2016年8月17日

LeetCode 344 Reverse String

摘要: 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) 推荐(0)
2016年8月8日

LeetCode 371 Sum of Two Integers

摘要: 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) 推荐(0)
2016年3月9日

Bookstore project using XAMPP 详细配置 Part 3

摘要: 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) 推荐(0)

Bookstore project using XAMPP 详细配置 Part 2

摘要: 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) 推荐(0)
2016年3月8日

Bookstore project using XAMPP 详细配置 Part 1

摘要: 这是学校的一个project,记录在这里,以备复习。主要是用XAMPP通过phpMyAdmin连接MySQL数据库,实现一个简单的查询功能。 Outline Setup of XAMPP Implementation of MySQL database in “phpMyAdmin” Create 阅读全文
posted @ 2016-03-08 00:51 wenchan 阅读(273) 评论(0) 推荐(0)