There is given input - words is sequence of numbers: $w_i$ is number in sequence, $i$ is position. All of them are in written in binary system.
$$w_1\#,...\#w_k\#i$$ Prove that there exists deterministic Turing machine which find $i$-th number in sorted sequence $w$ in logspace.
I am not sure if I correctly solved it, so I ask for checking my reasoning. It seems to be fairly simple.
First of all, what we can do in logspace:
compare two numbers
iter over sequence (move to $n$-th number)
Simply, we consider one by one each element of sequence and count how many elements is less than currently considered. If we count $i-1$ numbers, then we stop. It requires logarythmic($k$) memory for counter. These counter can be reused (for each iteration).
Waht do you think ? Maybe some other approach to proving it ?