• + 0 comments

    Hey @d_kokarev thanks for the input. I've looked at Fenwick trees and seem like the way to go. But I still have a hard time between the mapping of the Tree/Graph nodes, and the Fenwick tree indexes.

    The strategy lies in the DFS tree representation, where all children lay sequentially

    I assume you refer here to the array so called "edgeTo" which contains the information encoded after a DFS or BFS is done in a Tree/Graph of the connections between the nodes. I'm still a a loss as I mntioned in the mapping. Do you have any pointers on that? I would appreciate any help. Thanks in advance