
算法学习
gdmmzmj
这个作者很懒,什么都没留下…
展开
-
floyd算法
今天看了弗洛伊德算法。 他的本质是动态规划。 就是图中两点之间如何求最短距离呢 假设有n个点 假如我们中间只能经过前一个点,那么就是这么写for(i=1;i<=n;i++){ for(j=1;j<=n;j++) { if ( e[i][j] > e[i][1]+e[1][j] ) e[i][j] = e[i][1]+e[1原创 2016-05-06 13:40:31 · 584 阅读 · 0 评论 -
160. Intersection of Two Linked List(unsolved)
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘原创 2016-11-23 18:55:07 · 211 阅读 · 0 评论