• edited by
423 views
0 0 votes
There is a treasure hunt game in which parts of a treasure are hidden across $n$ islands, numbered $1$ to $n$. You start in island $1 ,$ and aim to collect all parts of the treasure, by hopping from island to island. Each island has a list of other islands you can directly go to. (Note that if you can directly go from island $i$ to island $j$, it does not necessary mean that you can directly go from $j$ to $i.)$ You can revisit the same island multiple times during your search. Design an algorithm that takes as input the number $n$ of islands, the $n$ neighbourhood lists, and determines if you can succeed in collecting all parts of the treasure. The algorithm should run in time $O\left(n^{2} \cdot 2^{n}\right)$.

Please log in or register to answer this question.

Position:
Show:

Related questions

1 1 vote
0 0 answers
521
521 views
admin asked Jul 22, 2022
521 views
A Muller automaton is defined as a tuple $\text{M} = (\text{Q}, \text{I}, \Sigma, \rightarrow, \text{T})$ where:$\text{Q}$ is a finite set of states;$\text{I} \subseteq \...
0 0 votes
1 1 answer
448
448 views
admin asked Jul 22, 2022
448 views
Consider the language $\text{L}$ over the alphabet $\left \{ a, b \right \}$ given below.$$\text{L}= \{ w \mid w \;\text{has equal number of $a$’s and $b$’s, and there a...
0 0 votes
0 0 answers
326
326 views
admin asked Jul 22, 2022
326 views
We say that an integer $a$ is co-prime to another integer $b$ if $\gcd(a, b) = 1$. For any integer $n, \varphi (n)$ is the number of integers from $1$ up to $|n|$ that a...
0 0 votes
1 answers 1 answer
417
417 views
admin asked Jul 22, 2022
417 views
You are organizing a party involving $2n$ diplomats. Each pair of diplomats are either friends or enemies. You have managed to invite an excellent set of guests, each of ...