Results 1 to 2 of 2

Thread: void recursive program that reverses a sentence

  1. #1
    Join Date
    Mar 2012
    Posts
    1

    void recursive program that reverses a sentence

    Ok I am a new programmer and i am absolutly clueless when it comes to changing strings for some reason i need to:

    Write a recursive methood void reverse() that reverses a sentence, and it must remove the first character, reverse a sentence consisting of the remaining text then combine the two and print it an explination of how it works would be very helpful too

    I CANT FIGURE IT OUT AND I AM PANICKING

  2. #2
    Join Date
    Jan 2006
    Posts
    605

    Re: void recursive program that reverses a sentence

    Since its a homework question, I would be providing some points below:
    • Using a reference is simpler than using pointers
    • You really need to increase the result, not set it to 0 or 1. Therefore you need to pass to first function call by reference an int with assigned value of 0.
    • Consider the formula: f(n) = f(n-1) + f(n-2) for all n > 2; f(n) = 0 for n=1 and f(n) = 1 for n=2.

Similar Threads

  1. Lets play the sentence game
    By jamesroy in forum Off Topic Chat
    Replies: 2
    Last Post: 06-02-2010, 05:31 PM
  2. Recursive Function For Generating Sudoku Puzzle
    By Adrina_g in forum Software Development
    Replies: 5
    Last Post: 04-02-2010, 10:51 PM
  3. How to extract Palindrome from a given sentence?
    By Baazigar in forum Software Development
    Replies: 4
    Last Post: 25-01-2010, 09:13 PM
  4. Recursive Problems With BSOD
    By Aakarshan.d in forum Operating Systems
    Replies: 4
    Last Post: 18-03-2009, 08:35 AM
  5. Forwarders cannot be validated and recursive query fails
    By Bennett in forum Windows Server Help
    Replies: 7
    Last Post: 26-02-2009, 08:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,102,902.45570 seconds with 17 queries