Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed (Author was flagged for spam)

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Towers of Hanoi Variant
Post Body

From Sedgewick's Computer Science: An Interdisciplinary Approach, exercise 2.3.25:

There are 2n discs of increasing size stored on three poles. Initially, all of the discs with odd size (1, 3, ..., 2n - 1) are piled on the left pole from top to bottom in increasing order of size; all of the discs with even size (2, 4, ..., 2n) are piled on the right pole. Write a program to provide instructions for moving the odd discs to the right pole and the even discs to the left pole, obeying the same rules as for towers of Hanoi.

Any ideas on how to approach this problem? I'm struggling to come up with a recursive solution.

Author
Account Strength
0%
Account Age
6 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,962
Link Karma
929
Comment Karma
1,015
Profile updated: 3 weeks ago
Posts updated: 2 weeks ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 months ago