<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DataStructuresAlgorithms.DataStructures.LinkedList;
using DataStructuresAlgorithms.DataStructures.LinkedList.SinglyLinkedList;
using DataStructuresAlgorithms.AbstractDataTypes;

namespace DataStructuresAlgorithms.DataStructures.Graph.DirectedGraphAdjacencyList
{
    public class DirectedGraphAdjacencyList<T> : IGraph<T>
    {
        public ILinkedList<INode<T>> Nodes { get; private set; }
        public int Count { get; private set; }
        public IQueue<INode<T>> Queue { get; set; }
        public IStack<INode<T>> Stack { get; set; }

        public DirectedGraphAdjacencyList()
        {
            Nodes = new SinglyLinkedList<INode<T>>();
        }

        public void FlagNodes(State state = State.Unvisited)
        {
            foreach(var node in this)
                node.State = state;
        }

        public void FlagNodesUnvisited()
        {
            FlagNodes(State.Unvisited);
        }

        public void Add(INode<T> node)<commit_msg>DirectedGraphAdjacencyList<T>: added constructor for dependency injection<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DataStructuresAlgorithms.DataStructures.LinkedList;
using DataStructuresAlgorithms.DataStructures.LinkedList.SinglyLinkedList;
using DataStructuresAlgorithms.AbstractDataTypes;

namespace DataStructuresAlgorithms.DataStructures.Graph.DirectedGraphAdjacencyList
{
    public class DirectedGraphAdjacencyList<T> : IGraph<T>
    {
        public ILinkedList<INode<T>> Nodes { get; private set; }
        public int Count { get; private set; }
        public IQueue<INode<T>> Queue { get; set; }
        public IStack<INode<T>> Stack { get; set; }

        public DirectedGraphAdjacencyList()
        {
            Nodes = new SinglyLinkedList<INode<T>>();
        }

        public DirectedGraphAdjacencyList(ILinkedList<INode<T>> nodeList,
            IStack<INode<T>> stack, IQueue<INode<T>> queue)
        {
            Nodes = nodeList;
            Stack = stack;
            Queue = queue;
        }

        public void FlagNodes(State state = State.Unvisited)
        {
            foreach(var node in this)
                node.State = state;
        }

        public void FlagNodesUnvisited()
        {
            FlagNodes(State.Unvisited);
        }

        public void Add(INode<T> node)
{'fraction_non_alphanumeric': 0.08711656441717791, 'fraction_numerical': 0.0, 'mean_word_length': 2.768875192604006, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1090810', 'n_tokens_mistral': 717, 'n_tokens_neox': 696, 'n_words': 145}