Answer
procedure onetoone $(x1,x2,x3,...xn,y1,y2,y3,...ym: $the domain and co-domain of some function $f(x),$ respectively$)$
Define a new set representing $m$ boolean values such that $b_i$ is true if and only if for some $x_α,f(x_α)=y_i$. {Initially, all $b_i:=$ false}
count $:=0$
for $i:=1$ to $n$
$\space\space\space$curvalue $:=f(x_i)$
$\space\space\space$ if $b_{curvalue}$ is false then $b_{curvalue}:=$ true
$\space\space\space$ else count $:= $ count + $1$
{This constitutes a violation of being one-to-one; count checks how many such violations occur}
if count is not $0$ then return true
else return false
{true and false here refer to the status of function as one-to-one}
Work Step by Step
This algorithm attempts to evaluate if a function is one-to-one or not. For a function to be one-to-one, each value of $x$ should map to a unique value of $y$ such that no two $x$ values map to the same $y$ value.
It does this by checking if for two different $x$ values, we get the same value $y$. If we've encountered this value of $y$ before, we increment one to count (indicating that we have found a violation) Note that we could terminate the algorithm as soon as such a violation occurred but this algorithm counts how many such violations occur.