Skip to content

Commit

Permalink
Update solutions/advanced/spoj-cot.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: envyaims <[email protected]>
  • Loading branch information
1Nigar357 and envyaims authored Jan 23, 2025
1 parent 9878da2 commit 74478a6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion solutions/advanced/spoj-cot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ author: Nigar Hajiyeva
---
## Explanation

This code solves the "Count on a Tree" problem using a persistent segment tree.
In this code, a persistent segment tree is built for each node in the tree by modifying that of its parent.

Each persistent segment tree keeps the frequency of numbers on the way from the root node to itself. When asked for the kth minimum node in the path of u to v, the code first determines the lowest common ancestor (LCA). Next, we run a binary search using the frequency values from the persistent segment tree of the three nodes.
Expand Down

0 comments on commit 74478a6

Please sign in to comment.