rank of node

Propose a tree based data structure to identify a node with nth rank with maximum efficiency .

Comments

  1. use a red-black tree with size of subtree as another element in the structure of each node.
    size(node) = size(node->left)+sizeof(node->right)+1;
    for each node rank = size(node->left)+1;

    ReplyDelete

Post a Comment

Popular posts from this blog