New answers tagged search-algorithms
How to cover elements with minimum amount of elements
Create the set of intervals $[3i - 3 \, x[i] - 2, 3 \, 3i + y[i] - 4]$, i.e., the left endpoint of the $i$th interval is $3i - 3 \, x[i]+1$ and the right endpoint is $3i + y[i] - 1$. Now look for a ...
An efficient algorithm to find a shortest cycle including a specific vertex
How can you reach from v to v using bfs? And bfs gives wrong ans for the graph-> 1 2 2 3 2 4 3 4 given that special vertex is 1. Here BFS will tell that there is a cycle but that cycle does not ...
Top 50 recent answers are included