Let $G=(V,E)$ be a graph.<br> $FindPaths(p,f)$ prints all paths which end in $f$ and can be obtained by adding nodes to path $p$. $p$ is for path, $f$ is for final (node).<br> Def $FindPaths(p,f)$:<br> Let $l$ be the last node of $p$.<br> For each edge $(l,v)$ for some $v$ in $E$<br> $\ \ \ \ $If $v$ is not in $p$<br> $\ \ \ \ $$\ \ \ \ $If $v=f$<br> $\ \ \ \ $$\ \ \ \ $$\ \ \ \ $Print $p-v$<br> $\ \ \ \ $$\ \ \ \ $Else<br> $\ \ \ \ $$\ \ \ \ $$\ \ \ \ $$FindPaths(p-v,f)$<br><br> If $s$ is the start node and $t$ is the ending node, run $FindPaths(s,t)$. You can represent path and edges as strings. To check if a node is in a path $p$ you just have to check whether the string contains the character that represents the node. To get the final node of a path use the function to get the last character of a string.