Esempio n. 1
0
        void AddNodes(TriangleNode <T> node, T value)
        {
            if (node == null)
            {
                node = new TriangleNode <T>(value);
                return;
            }
            else
            {
                //get the pointer

                TriangleNode <T> current = node;

                while (true)
                {
                    if (current.left == null)
                    {
                        current.left = new TriangleNode <T>(value);
                        break;
                    }

                    if (current.right == null)
                    {
                        current.right = new TriangleNode <T>(value);
                        break;
                    }
                }
                if (node.left == null)
                {
                    node.left = new TriangleNode <T>(value);
                    return;
                }
            }
        }
Esempio n. 2
0
 void CalculateSum(TriangleNode <T> rootNode)
 {
 }