Recurrence relations

This is a discussion on Recurrence relations within the General Discussions forums, part of the Community Boards category; I have this question and not sure if i answer it properly SumU(S,x,y) if x=y return S[x] else return S[x] ...

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    4

    Recurrence relations

    I have this question and not sure if i answer it properly

    SumU(S,x,y)
    if x=y
    return S[x]
    else
    return S[x] + SumU(S,x+1,y)


    i was asked to give the recurrence relation for the time taken to sum a length -n set of values from S and give the recursive and base cases?

    Im not sure if T(n) = n-1
    base case T(1) = 0

    if you can explain how can i do this properly and easily cuz i don't understand the way done in the book?

  2. #2
    Registered User
    Join Date
    Sep 2012
    Posts
    11
    is it C?

  3. #3
    Registered User
    Join Date
    Sep 2012
    Posts
    4
    Yes it is C! its about algorithm analysis

  4. #4
    Registered User
    Join Date
    Sep 2012
    Posts
    4
    Please anyone!

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,808
    Recurrence relations are somewhat related to computer programming, but certainly do not constitute a C programming question in itself.

    *moved to General Discussions*
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Registered User
    Join Date
    Sep 2012
    Posts
    4
    ok so now i need an answer to my questions anyone?? I have gave an answer and want some help!!!

  7. #7
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,832
    This website may help you.
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. composition relations
    By student111 in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2012, 02:01 PM
  2. Help to do a calcutalor for arithmetic and relations !!!!Pls
    By ryannguyen100 in forum C++ Programming
    Replies: 1
    Last Post: 10-26-2011, 10:43 PM
  3. A Recurrence Problem
    By euclid in forum C Programming
    Replies: 3
    Last Post: 12-02-2010, 11:53 AM
  4. Recurrence Relation..Help needed!
    By anirban in forum Tech Board
    Replies: 2
    Last Post: 03-04-2009, 11:01 AM
  5. Difference Equations / Recurrence Relations
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 10-05-2007, 10:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21