-
March 31st, 2011, 11:29 PM
#1
Recursive Code
Hi.
I have a challenge for someone on here, because I can't seem to figure this out.
I am trying to write a program that takes a particular topic page on wikipedia and, using only links available on that topic page for navigations, recursively finds the quickest way from that topic page to a specified other topic page.
Ex.
If i wanted to get from the wiki page on "apples", to the wiki page on"bananas", I would need to click a link on apples and get to another wiki page on a different topic. From that page, i would click a link and get to another topic. My end goal would be to get the "bananas" page.
I have attempted this, and my code only hits the first link on every page and im not sure how to stop it from moving further (i.e. I have no idea what my base case is/could be).
Anyone who thinks they can write this and/or help me figure out what I'm doing wrong, please respond
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|