TimeOf() публичный Метод

public TimeOf ( IVertex item ) : int
item IVertex
Результат int
		private static void Visit(IVertex node, ColorsSet colors,
								  TimestampSet discovery, TimestampSet finish, LinkedList<IVertex> list, ref int time)
		{
			colors.Set(node, VertexColor.Gray);

			discovery.Register(node, time++);

			foreach(IVertex child in node.Adjacencies)
			{
				if (colors.ColorOf(child) == VertexColor.White)
				{
					Visit(child, colors, discovery, finish, list, ref time);
				}
			}

			finish.Register(node, time++);

#if DEBUG
			Debug.Assert(discovery.TimeOf(node) < finish.TimeOf(node));
#endif

			list.AddFirst(node);

			colors.Set(node, VertexColor.Black);
		}
Пример #2
0
        private static void Visit(IVertex node, ColorsSet colors, TimestampSet discovery, TimestampSet finish, LinkedList <IVertex> list, ref int time)
        {
            colors.Set(node, VertexColor.Gray);

            discovery.Register(node, time++);

            foreach (var child in node.Adjacencies)
            {
                if (colors.ColorOf(child) == VertexColor.White)
                {
                    Visit(child, colors, discovery, finish, list, ref time);
                }
            }

            finish.Register(node, time++);

            Debug.Assert(discovery.TimeOf(node) < finish.TimeOf(node));

            list.AddFirst(node);

            colors.Set(node, VertexColor.Black);
        }