I have seen a problem set for the tower of hanoi algorithm that states:
Each integer in the second line is in the range 1 to K where the i-th integer denotes the peg to which disc of radius i is present in the initial configuration.
What does i-th actually mean? If i have a line conforming to the format above such as:
4 2 4 3 1 1
How exactly does this translate to the format described above?
The statement that
is shorthand for this statement:
The list $4,2,4,3,1,1$ indicates that the disk of radius $1$ starts on peg $4$, the disk of radius $2$ starts on peg $2$, the disk of radius $3$ starts on peg $4$, the disk of radius $4$ starts on peg $3$, and the disks of radius $5$ and $6$ start on peg $1$. The configuration is therefore this one, where the numbers in the array are the radii of the disks.
$$\begin{array}{cc} \text{Peg }1&\text{Peg }2&\text{Peg }3&\text{Peg }4\\ \hline 5&&&1\\ 6&2&4&3 \end{array}$$