摘要:1 前言
随着internet的飞速发展,网络应用越来越广泛,对各种工业控制设备的网络功能要求也越来越高。当前的要求是希望工业控制设备能够支持tcp/ip以及其它internet协议,从而能够通过用户熟悉的浏览器查看设备状态、设置设备参数,或者将设备采集到的数据通过网络传送到windows或unix/linux服务器上的数据库中。这就要求工控系统必须具备两方面的功能:一是要在现场完成复杂的测控任务,因为通常一些任务都具有一定的实时性要求;二是要求测控系统......
摘要:/*文件名:cvar.cpp环境:win2k sp4+vc6作者: vical lee完成日期:2004-9-12 晨1:00版本:1.0描述:测试如何在子程序里修改主程序的局部参数.*/#include <stdio.h>#include <string.h>
void foo(void);
int main(int argc, char* argv[]){ int a = 3, b = 4; char c = ´......
Data Structures with .NET - Part 5: From Trees to Graphsan extensive examination of data structures
scott mitchell 【相关文章:
关于Linux常见紧急情况的处理方法】
part 5: from trees to graphs 【扩展阅读:
Peer-to-Peer (P2P) c】4guysfromrolla.com 【扩展信息:
理解Linux 配置文件】
march 2004
summary: a graph, like a tree, is a collection of nodes and edges, but has no rules dictating the connection among the nodes. in this fifth part of the article series, we´ll learn all about graphs, one of the most versatile data structures. (26 printed pages)
download the graphs.msi sample file.
contents
introduction examining the different classes of edges creating a c# graph class a look at some common graph algorithms conclusion related books
introduction
part 1 and part 2 of this article series focused on linear data structures—the array, the arraylist, the queue, the stack, and the hashtable. in part 3, we began our investigation of trees. recall that trees consist of a set of nodes, where all of the nodes share some connection to other nodes. these connections are referred to as edges. as we discussed, there are numerous rules as to how these connections can occur. for example, all nodes in a tree except for one—the root—must have precisely one parent node, while all nodes can have an arbitrary number of children. these simple rules ensure that, for any tree, the following three statements will hold true:
1.????????????????? starting from any node, any other node in the tree can be reached. that is, there exists no node that can´t be reached through some simple path.
2.????????????????? there are no cycles. a cycle exists when, starting from some node v, there is some path that travels through some set of nodes v1, v2, ..., vk that then arrives back at v.
3.????????????????? the number of edges in a tree is precisely one less than the number of nodes.
in part 3 we focused on binary trees, which are a special form of trees. binary trees are trees whose nodes have at most two children.
in this fifth installment of the article series we´re going to examine graphs. graphs are composed of a set of nodes and edges, just like trees, but with graphs there are no rules for the connections between nodes. with graphs, there is no concept of a root node, nor is there a concept of parents and children. rather, a graph is a collection of interconnected nodes.
note???realize that all trees are graphs. a tree is a special case of a graph in which all nodes are reachable from some starting node and one that has no cycles.
figure 1 shows three examples of graphs. notice that graphs, unlike trees, can have sets of nodes that are disconnected from other sets of nodes. for example, graph (a) has two distinct, unconnected sets of nodes. graphs can also contain cycles. graph (b) has several cycles. one cycle is the path from v1 to v2 to v4 and back to v1. another one is from v1 to v2 to v3 to v5 to v4 and back to v1. (there are also cycles in graph (a).) graph (c) does not have any cycles, as it has one less edge than it does number of nodes, and all nodes are reachable. therefore, it is a tree.
figure 1. three examples of graphs
many real-world problems can be modeled using graphs. for example, search engines like google model the internet as a graph, where web pages are the nodes in the graph and the links among web pages are the edges. programs like microsoft mappoint that can generate driving directions from one city to another use graphs, modeling cities as nodes in a graph and the roads connecting the cities as edges.
examining the different classes of edges
graphs, in their simplest terms, are a collection of nodes and edges, but there are different kinds of edges:
·???????????????????? directed versus undirected edges
·???????????????????? weighted versus unweighted edges
when talking about using graphs to model a problem, it is important to indicate the class of graph with which you are working. is it a graph whose edges are directed and weighted, or one whose edges are undirected and weighted? in the next two sections, we´ll discuss the differences between directed and undirected edges and weighted and unweighted edges.
directed and undirected edges
the edges of a graph provide the connections between one node and another. by default, an edge is assumed to be bidirectional. that is, if there exists an edge between nodes v and u, it is assumed that one can travel from v to u and from u to v. graphs with bidirectional edges are said to be undirected graphs because there is no implicit direction in their edges.
for some problems, though, an edge might infer a one-way connection from one node to another. for example, when modeling the internet as a graph, a hyperlink from web page v linking to web page u would imply that the edge between v to u would be unidirectional. that is, that one could navigate from v to u, but not from u to v. graphs that use unidirectional edges are said to be directed graphs....
下一页 摘要:/*
文件名:cpyimg.cpp
平台: win2k sp4+vc6
作者:vicallee
版本:1.0
完成日期:2004-9-10
描述:1.
把当前目录下的六个文件复制到指定目录下的某些目录,
复制的条件是:此目录下有001.htm.
2.修改001.htm和top.htm,把它们中的"../"变为" ./"
3.把top.htm中的<td><img......