Algorithm 我需要知道以下情况下我应该选择哪种算法
我有四个组件Algorithm 我需要知道以下情况下我应该选择哪种算法,algorithm,sorting,data-structures,graph-algorithm,storing-data,Algorithm,Sorting,Data Structures,Graph Algorithm,Storing Data,我有四个组件A、B、C、D。哪个依赖项流类似于A->B->C->D。 A依赖于B,B依赖于C,C依赖于D。在这种情况下,我应该使用哪种类型的算法。您要查找的算法是拓扑排序 Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u-v, vertex u comes before v in the orderin
A、B、C、D
。哪个依赖项流类似于A->B->C->D
。
A依赖于B,B依赖于C,C依赖于D。在这种情况下,我应该使用哪种类型的算法。您要查找的算法是拓扑排序
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of
vertices such that for every directed edge u-v, vertex u comes before v in the
ordering. Topological Sorting for a graph is not possible if the graph is not
a DAG.
请提供您正试图解决的用例的详细信息,也许有一个例子。另外,分享你已经尝试过的细节。目前提供的信息模糊且不完整。您好,您的问题太宽泛,请检查并将您的问题置于上下文中,在这种情况下,我认为没有人会理解您的观点。