d

r

n

n != 0

 

 

0

12345

True

1st iteration

5

5

1234

True

2nd iteration

4

54

123

True

3rd iteration

3

543

12

True

4th iteration

2

5432

1

True

5th iteration

1

54321

0

FALSE