07 2015 档案

Intersection of Two Linked Lists
摘要: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: a... 阅读全文

posted @ 2015-07-19 18:45 winters1992x 阅读(93) 评论(0) 推荐(0)

LeetCode Path Sum
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文

posted @ 2015-07-19 18:37 winters1992x 阅读(91) 评论(0) 推荐(0)

BFS广度优先算法的思路
摘要:广度优先算法的思想是对所有的Node进行遍历 然后将第一个Node入队列 设置其visited为真 然后 对第一个Node跟其它剩余的Node进行遍历对比 找出连通的Node 并将其visited属性赋值为真然后将其入队列 接下来对队列里面的Node进行迭代处理 最终完全遍历所有节点 阅读全文

posted @ 2015-07-17 21:17 winters1992x 阅读(249) 评论(0) 推荐(0)

DFS深度搜索的一般思想
摘要:对于无向图来说DFS深度搜索 递归思想//深度优先搜索DFS的一般实现void DFS(MGraph G,int i)//DFS递归思想{ int j; visited[i]=TRUE;//设置Node已经被访问 printf("%c",G.vexs[i]); for(j=0... 阅读全文

posted @ 2015-07-17 20:45 winters1992x 阅读(475) 评论(0) 推荐(0)

无向表 链表存储方式
摘要:#include "stdio.h"#include "stdlib.h"#define MAXVEX 10typedef char VertexType;typedef int EdgeType;typedef struct EdgeNode{ int adjvex; EdgeType... 阅读全文

posted @ 2015-07-17 19:10 winters1992x 阅读(209) 评论(0) 推荐(0)

接雨水-算法题
摘要:#include /* run this program using the console pauser or add your own getch, system("pause") or input loop */#define MAX 12//lintcode water area quest... 阅读全文

posted @ 2015-07-16 18:40 winters1992x 阅读(385) 评论(0) 推荐(0)

导航