Exemple #1
0
        public void LinkedListContainsAndAddTest(int value, params int[] values)
        {
            //arrange
            ILinkedList <int> linkedList = new AssociativeLinkedList <int>(values);

            //act
            linkedList.Add(value);

            //assert
            Assert.IsTrue(linkedList.Contains(value));
        }
Exemple #2
0
        private AssociativeLinkedList <T> GetRightBranch(AssociativeTreeNode <T>[] array, AssociativeTreeNode <T> associativeTreeNode)
        {
            AssociativeLinkedList <T> associativeLinkedList = new AssociativeLinkedList <T>();

            while (associativeTreeNode != null)
            {
                associativeLinkedList.Add(associativeTreeNode.Value);
                associativeTreeNode = (associativeTreeNode.Right != -1) ? array[associativeTreeNode.Right] : null;
            }

            return(associativeLinkedList);
        }