自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

lovelling的博客

编程随想

  • 博客(14)
  • 收藏
  • 关注

原创 知乎爬虫项目记录

这是一个知乎爬虫项目简书地址 http://www.jianshu.com/p/da2cdf52c4a6项目地址 https://github.com/rensuperk/javaSpider根据知乎用户爬取所有和用户相关的数据数据包括关注者,被关注者,文章,专栏,想法,提问,答案,和用户相关的其他信息应的框架有jdk1.8spring-boot –基本架构spring-data-elasti

2017-09-15 16:31:11 811

原创 500. Keyboard Row

500. Keyboard Row代码链接Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below.American keyboard Example 1:Input:

2017-04-19 17:53:17 363

原创 476. Number Complement

476. Number Complement代码链接Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit wi

2017-04-19 15:25:31 227

原创 461.Hamming Distance

461.Hamming Distance代码链接between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note:0 ≤ x, y < 231.

2017-04-19 15:25:15 217

原创 339. Nested List Weight Sum

339. Nested List Weight Sum代码链接Given a nested list of integers, return the sum of all integers in the list weighted by their depth.Each element is either an integer, or a list – whose elements may also

2017-04-19 15:24:57 329

原创 557. Reverse Words in a String III

557. Reverse Words in a String III代码链接Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input

2017-04-19 15:24:34 271

原创 461.HammingDistance解题

461.Hamming Distance

2017-04-07 18:22:36 204

原创 算法导论2.3-5二分法查找问题

public static void main(String[] args) { int[] s = {3, 2, 4, 5, 7, 6, 1,8}; int getmin = getmin(s, 0, s.length - 1); System.out.println(getmin); } private static int getm

2016-09-30 14:41:34 345

原创 2.3-4将插入排序写成个递归的排序

//递归的写法 private static void sortdigv(int[] s,int n){ if(n >0){ sortdigv(s,n-1); sort(s,n); } } private static void sort(int[] s,int n){ int k

2016-09-30 13:56:05 979

原创 2.3-3时间复杂度的推导过程

推导过程 n=2 T(2) = 2; n=4 T(4) = 2*T(2)+4 = 8 n=8 T(8) = 2*T(4)+8 = 2*( 2*T(2)+4) + 8 …..递归树表示就是类似于 就是本题的递归树,我就不再这里画了,实在费劲 递归树的总层数为lgn 每层的总消耗为2n 那么T(n)的总消耗为2nlgn 去掉常数即为θ(nlgn)

2016-09-30 11:31:40 1433 1

原创 算法导论2.3MERGE-SORT(分治或者合并排序算法)

public static void main(String[] args) { int[] s = {3, 2, 4, 5, 7, 6, 1}; //注意下标的选取,用伪代码都需要+1 sort(s,0,6); print(s); } private static void print(int[] s){

2016-09-29 22:35:21 364

原创 算法导论2.2-2selection-sort(选择排序)

执行过程 - 找到数组中的最小值,与第一个位置互换,1,2,4,5,7,6,3 - 找到s[2…n]中的最小值,与第二个互换位置,1,2,4,5,7,6,3 - 依次类推 - 直到s[n-1,n]排完,只剩一个数无需再排,所以输出数组注意事项 - 只需排序n-1次即可 - 当找到最小值的时候只需记录下下标即可,减省运行时间 - 最后替换位置, - min用于记录最小值

2016-09-29 16:44:24 332

原创 算法导论2.1-insertsort算法(插入排序)

这个算法我没有看原理没有看演示图就开始着手写了, 以为自己几年编程经验完成它几乎不会费力气 但是话费了我快一个小时,结果总是不对 后来追bug发现根本就进不去替换位置的分支 开始意识到是我的条件可能用的有问题 所以改了条件结果才实现 做这个需要注意的点就是条件的判断初始化的复制循环的组织细节原谅我的排版public static void main(String[] args)

2016-09-29 10:26:49 439

原创 #if 标签判断是否存在的问题及解决思路

{{#if auditType}} {{#compare auditStatus '0'}} <div class="title-nav clearfix"> <span class="title-name px18 fl"><b>个人资料</b></span>     <span cla

2016-04-01 11:33:32 2189

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除