I really need help with this task here. Im stuck at it and I really would appreciate your help
Here is the task:
Give a recursive function $r$ on $A$ that reverses a string. For instance, $r(logikk) = kkigol$ and $r(moro) = orom$. (given that $A$ the amount of letters in the Norwegian alphabet which has 29 letters.). Define the function in such a way that it is correctly regardless of what $A$ are.
Also $logikk$ means $logic$ in norwegian, and $moro$ means $fun$ in norwegian in case you're wondering.
Edit:
I tried to solve one of the recursive functions, $r(logikk)$, but i'm not sure if all of it is correct:
$\Lambda =$ The empty string
$r(\Lambda) =$ $\Lambda$, $r(k) = k$, $r(k) = k$, $r(i) = i$, $r(g) = g$, $r(o) = o$, $r(l) = l$
For any word $w$ and letter $a$, $r(wa) = wa$
Can someone please check if this is correct for $r(logikk)$ I feel like i'm missing something but i'm not sure what.