Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9200783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:50:40+00:00 2026-06-17T22:50:40+00:00

In Cormen’s Introduction to Algorithm’s book, I’m attempting to work the following problem: Show

  • 0

In Cormen’s Introduction to Algorithm’s book, I’m attempting to work the following problem:

Show that the solution to the recurrence relation T(n) = T(n-1) + n is O(n2 ) using substitution

(There wasn’t an initial condition given, this is the full text of the problem)

However, I can’t seem to find out the correct process. The textbook only briefly touches on it, and most sites I’ve searched seem to assume I already know how. If someone could give me a simple, step by step guide, or even a link to one, I would appreciate it.

For kicks, here’s my attempt so far:

T(n) <= c(n^2)
       <= c(n-1)^2 + n
       <= c(n^2 -2n +1) + n (which I’m pretty sure is not < c(n^2))

Thanks again.

UPDATE: Here’s an example of the method I’m trying to accomplish, to avoid confusion.

Prove the solution is O(nlog(n))
T(n) = 2T([n/2]) + n
The substitution method requires us to prove that T(n) <= cn*lg(n) for a choice of constant c > 0. Assume this bound holds for all positive m < n, where m = [n/2], yielding T([n/2]) <= c[n/2]*lg([n/2]). Substituting this into the recurrence yields the following:
T(n) <= 2(c[n/2]*lg([n/2])) + n
       <= cn*lg(n/2) + n
       = cn*lg(n) – cn*lg(2) + n
       = cn*lg(n) – cn + n
       <= cn*lg(n)
where the last step holds as long as c >= 1

I can follow this logic just fine, but when I attempt to duplicate the steps in the problem above, I get stuck.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:50:41+00:00Added an answer on June 17, 2026 at 10:50 pm

    I guess this is supposed to be induction?

    So base case n=1 is trivial. Induction case, assume n>1. (*) Suppose T(n-1) is O((n-1)2)=O(n2). Show that T(n) is also O(n2).

     T(n) = T(n-1) + n
          < c (n-1)^2 + n,  assume c>1 wlog
          < c n^2 - 2cn + c + n
          < c n^2 - (2c - 1)n + c
          < c n^2
    

    for n > 1, c > 1.

    Here is the break out:

    First, notice that when c > 1, 2c – 1 > c, so you have

          < c n^2 - (2c - 1)n + c
          < c n^2 - (c)n + c
    

    Next, notice that when n > 1, -(c)n+c = (1-n) c < 0, so you have

          < c n^2 - (c)n + c
          < c n^2
    

    Since there is a constant c such that T(n) < c n^2, clearly T(n) is O(n2).

    Is that roughly along the line of what you want? Had to edit it a bunch of times to fix edge cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The book Introduction to algorithms by Cormen has a question post office location problem
I am reading about string algorithms in Cormen's book Introduction to Algorithms. For Transition
I am reading about String algorithms in Introduction to Algorithms by Cormen etc Following
I am reading about Dynamic programming in Cormen etc book on algorithms. following is
While studying the book Introduction to Algorithms by Cormen, I found a strange thing.
This is based on the algorithm given in the Cormen's book. What am I
I am working through the Introduction to Algorithms book by Cormen, and I have
I'm looking for a book similar to Introduction to Algorithms by Thomas Cormen geared
I read Introduction to Algorithms by Cormen&Co and implement algorithm on java. I wonder
I'm reading the Cormen algorithms book (binary search tree chapter) and it says that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.