As it is shown in the fig, we have a graph G(V, E).1. Inpdependent Set: A set of nodes S\( \subset \)V is independent if no pair of nodes from S is co...
分类:
其他好文 时间:
2015-11-03 12:05:15
阅读次数:
144
本文是[数据结构基础系列(7):图]中第6课时[图的遍历]的例程。1、深度优先遍历——DFS(linklist.h是图存储结构的“算法库”中的头文件,详情请单击链接…)#include
#include
#include "graph.h"
int visited[MAXV];
void DFS(ALGraph *G, int v)
{
ArcNod...
分类:
其他好文 时间:
2015-11-03 00:47:34
阅读次数:
260
进程管理进程的基本概念程序的顺序执行及其特征程序的顺序执行:仅当前一操作(程序段)执行完后,才能执行后续操作。程序顺序执行时的特征:顺序性,封闭性,可再见性。前趋图前趋图(Precedence Graph)是一个有向无循环图,记为DAG(Directed Acycilc Graph),用于描述进程之...
分类:
系统相关 时间:
2015-11-02 17:25:37
阅读次数:
414
Clone GraphClone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are l...
分类:
其他好文 时间:
2015-10-29 12:37:55
阅读次数:
242
做过几次拍照,相册选取图片,但都记不住,这次发表个简单的保存下private static final int PHOTO_GRAPH = 1;// 拍照 private static final int PHOTO_ALBUM = 2; // 相册获取 private static f...
分类:
移动开发 时间:
2015-10-27 15:19:50
阅读次数:
219
Check whether a given graph is Bipartite or notABipartite Graphis a graph whose vertices can be divided into two independent sets, U and V such that e...
分类:
其他好文 时间:
2015-10-24 11:24:27
阅读次数:
271
Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second.For example, in the following graph...
分类:
其他好文 时间:
2015-10-23 20:09:08
阅读次数:
213
New stuff learnt - Union-Find. Simpler and more elegant than I thought.class Solution { unordered_map father; int find(int val) { if(!...
分类:
其他好文 时间:
2015-10-21 14:08:51
阅读次数:
191
Treap的基础题目,Treap是个挺不错的数据结构。 1 /* */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #incl...
分类:
其他好文 时间:
2015-10-20 12:17:48
阅读次数:
258
称号:http://community.topcoder.com/stat?c=problem_statement&pm=13251&rd=16017參考:http://apps.topcoder.com/wiki/display/tc/TCO+2014+Round+2C假设用先计算出每条边,用邻接...
分类:
其他好文 时间:
2015-10-18 23:05:37
阅读次数:
246