Exemplo n.º 1
0
    static void Main(string [] args)
    {
        int [] a   = { 3, 6, 1, 7, 2, 8, 4, 9, 10 };
        var    bit = new BIT(a.Length);

        bit.Build(a);
        bit.Print();
        Console.WriteLine(bit.Sum(a.Length - 1));
        bit.Update(3, 2);
        Console.WriteLine(bit.Sum(1, 3));
    }