2017年10月19日

最大利润-城市A和B

摘要: 1,问题描述 jack每天同时只能在A和B其中一个城市工作赚钱,假设两个城市间的交通费为m。已知每天在A 和 B 能赚到多少钱,那么jack怎么选择每天工作的城市才能赚到最大利润。 比如 moneyA = {1,2,3,4,3,1};moneyB = {2,1,3,4,2,1};m = 1。 2,边 阅读全文

posted @ 2017-10-19 22:46 Shihu 阅读(228) 评论(0) 推荐(0) 编辑

2017年10月17日

leetcode--138. Copy List with Random Pointer

摘要: 1,问题描述 A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a de 阅读全文

posted @ 2017-10-17 22:52 Shihu 阅读(212) 评论(0) 推荐(0) 编辑

lecture-9-hashmap

摘要: 1、hashmap基本操作 2、hash function,equals函数,hashCode 3、练习题 1)Two Sum Given an array of integers, return indices of the two numbers suchthat they add up to 阅读全文

posted @ 2017-10-17 21:45 Shihu 阅读(208) 评论(0) 推荐(0) 编辑

lecture-11

摘要: heap数据结构 阅读全文

posted @ 2017-10-17 21:44 Shihu 阅读(118) 评论(0) 推荐(0) 编辑

递归

摘要: http://chenqx.github.io/2014/09/29/Algorithm-Recursive-Programming/ http://langgufu.iteye.com/blog/1168366 阅读全文

posted @ 2017-10-17 21:44 Shihu 阅读(124) 评论(0) 推荐(0) 编辑

最近公共祖先LCA

摘要: http://m.blog.csdn.net/llzk_/article/details/53403955 阅读全文

posted @ 2017-10-17 21:43 Shihu 阅读(134) 评论(0) 推荐(0) 编辑

微软面试100题

摘要: http://m.blog.csdn.net/v_july_v/article/details/6870251 阅读全文

posted @ 2017-10-17 21:40 Shihu 阅读(90) 评论(0) 推荐(0) 编辑

0-1背包问题

摘要: 链接:http://blog.csdn.net/chenxun_2010/article/details/42045065 链接:http://www.cnblogs.com/shinning/p/6027743.html /* dp[i][j] 背包总重j时,前i个物品的最大价值 */ int p 阅读全文

posted @ 2017-10-17 21:38 Shihu 阅读(129) 评论(0) 推荐(0) 编辑

ubuntu网络已禁用解决办法

摘要: 1.首先停掉network-manager这个服务 sudo service network-manager stop 2.删除掉NetworkManager.state这个文件 sudo rm /var/lib/NetworkManager/NetworkManager.state 3.启动net 阅读全文

posted @ 2017-10-17 21:37 Shihu 阅读(2309) 评论(0) 推荐(0) 编辑

2017年10月14日

leetcode-70. Climbing Stairs

摘要: 原题描述: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can 阅读全文

posted @ 2017-10-14 23:09 Shihu 阅读(178) 评论(0) 推荐(0) 编辑

导航