#include "../data-structures/RMQ.h"
struct LCA {
int T = 0;
vi time, path, ret;
RMQ<int> rmq;
LCA(vector<vi>& C) : time(sz(C)), rmq((dfs(C,0,-1), ret)) {}
void dfs(vector<vi>& C, int v, int par) {
// ...
}
// ...
};
In this line rmq((dfs(C,0,-1), ret))
, I don't understand how (dfs(C,0,-1), ret)
forms a valid input argument (i.e. a vector<int>
) for the RMQ constructor. What do the surrounding parentheses do and how are the dfs()
and ret
used?