qeatzy

2015年8月1日

my understanding of (lower bound,upper bound) binary search, in C++, thanks to two post 分类: leetcode 2015-08-01 14:35 113人阅读 评论(0) 收藏

摘要: If you understand the comments below, never will you make mistakes with binary search! thanks to A simple CPP solution with lower_bound and C+... 阅读全文

posted @ 2015-08-01 14:35 qeatzy 阅读(161) 评论(0) 推荐(0) 编辑

2015年7月22日

learn python, ref, diveintopython 分类: python 2015-07-22 14:42 14人阅读 评论(0) 收藏

摘要: for notes of learing python. // just ignore the ugly/wrong highlight for python code."""odbchelper.py sample scriptThis program is part of "Di... 阅读全文

posted @ 2015-07-22 14:42 qeatzy 阅读(146) 评论(0) 推荐(0) 编辑

2015年7月19日

one recursive approach for 3, hdu 1016 (with an improved version) , permutations, N-Queens puzzle 分类: hdoj 2015-07-19 16:49 86人阅读 评论(0) 收藏

摘要: one recursive approach to solve hdu 1016, list all permutations, solve N-Queens puzzle. reference: the video of stanford cs106b lecture 10 by ... 阅读全文

posted @ 2015-07-19 16:49 qeatzy 阅读(126) 评论(0) 推荐(0) 编辑

2015年7月18日

hdu 1503, LCS variants, find a LCS, not just the length, backtrack to find LCS, no extra markup 分类: hdoj 2015-07-18 16:24 139人阅读 评论(0) 收藏

摘要: a typical variant of LCS algo. the key point here is, the dp[][] array contains enough message to determine the LCS, not only the length, but ... 阅读全文

posted @ 2015-07-18 16:24 qeatzy 阅读(129) 评论(0) 推荐(0) 编辑

hdu, KMP algorithm, linear string search algorithm, a nice reference provided 分类: hdoj 2015-07-18 13:40 144人阅读 评论(0) 收藏

摘要: reference: Rabin-Karp and Knuth-Morris-Pratt Algorithms By TheLlama– TopCoder Member https://www.topcoder.com/community/data-science/data-scie... 阅读全文

posted @ 2015-07-18 13:40 qeatzy 阅读(126) 评论(0) 推荐(0) 编辑

hdu 1712, multiple-choice knapsack, 分类: hdoj 2015-07-18 13:25 152人阅读 评论(0) 收藏

摘要: reference: 6.4 knapsack in Algorithms(算法概论), Sanjoy Dasgupta University of California, San Diego Christos Papadimitriou University of Californ... 阅读全文

posted @ 2015-07-18 13:25 qeatzy 阅读(151) 评论(0) 推荐(0) 编辑

2015年7月16日

hdu 1232, disjoint set, linked list vs. rooted tree, a minor but substantial optimization for path c 分类: hdoj 2015-07-16 17:13 116人阅读 评论(0) 收藏

摘要: three version are provided. disjoint set, linked list version with weighted-union heuristic, rooted tree version with rank by union and path c... 阅读全文

posted @ 2015-07-16 17:13 qeatzy 阅读(168) 评论(0) 推荐(0) 编辑

hdu 1082, stack emulation, and how to remove redundancy 分类: hdoj 2015-07-16 02:24 86人阅读 评论(0) 收藏

摘要: use fgets, and remove the potential ‘\n’ in the string’s last postion.(main point) remove redundancy there must be a stack, at first sight, y... 阅读全文

posted @ 2015-07-16 02:24 qeatzy 阅读(153) 评论(0) 推荐(0) 编辑

2015年7月12日

hdu 1231, dp ,maximum consecutive sum of integers, find the boundaries, possibly all negative, C++ 分类: hdoj 2015-07-12 03:24 87人阅读 评论(0) 收藏

摘要: the algorithm of three version below is essentially the same, namely, Kadane’s algorithm, which is of O(n) complexity. https://en.wikipedia.or... 阅读全文

posted @ 2015-07-12 03:24 qeatzy 阅读(168) 评论(0) 推荐(0) 编辑

2015年7月10日

hdu 1159, LCS, dynamic programming, recursive backtrack vs iterative backtrack vs incremental, C++ 分类: hdoj 2015-07-10 04:14 112人阅读 评论(0) 收藏

摘要: thanks prof. Abhiram Ranade for his vedio on Longest Common Subsequence ‘s back track search view in lecture 19, nice explanation indeed.// ba... 阅读全文

posted @ 2015-07-10 04:14 qeatzy 阅读(202) 评论(0) 推荐(0) 编辑

导航