摘要:
1.直接建立两个100001长度的数组,一个用来当作链表使用,一个用来当作后面的哈希查询使用2.遍历第一个链表,把第一个链表中存在的节点记录在哈希表中3.遍历第二个链表,如果哈希中存在某个节点的值,就break,最终输出该节点值4.把地址改为int存储,最后输出注意-1和其他的补0的情况下面为AC代... 阅读全文
posted @ 2015-11-14 22:07
siukwan
阅读(145)
评论(0)
推荐(0)
摘要:
1.通过n1= n3= max { k| k //#include #include#include //#include#include#include#include//#include//#include//#include //#include "func.h"//#include #inc... 阅读全文
posted @ 2015-11-14 20:41
siukwan
阅读(112)
评论(0)
推荐(0)
摘要:
1.仍然是先使用Dijkstra求出最短距离,然后使用深度搜索遍历,以最短距离作为条件进行剪枝,最后求出最短距离的基础上耗费最小的路径//#include//#include #include#include //#include#include#include#include//#include/... 阅读全文
posted @ 2015-11-14 19:50
siukwan
阅读(85)
评论(0)
推荐(0)
摘要:
1.这道题目与leetcode中的Median of Two Sorted Arrays相似,只是偶数情况取前一个,不用求平均2.采用二分法进行查找数组分为如下部分{a[0],a[1],a[2],....a[i-1] | a[i],a[i+1],...a[m-1]}{b[0],b[1],b[2],... 阅读全文
posted @ 2015-11-14 18:03
siukwan
阅读(121)
评论(0)
推荐(0)

浙公网安备 33010602011771号