I was decoding a c++ code and did not understand why is the vertical bar is used in the 6th line.
void build(int id, int l, int r) {
if (l == r) {
sum[id] = a[l];
return;
}
int mid = (l + r) >> 1;
build(id << 1, l, mid);
build(id << 1 | 1, mid + 1, r); /*what operation does vertical
bar perform with bitwise operator*/
sum[id] = max(sum[id << 1], sum[id << 1 | 1]);
}