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

  • SEARCH
  • Home
  • 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 6655017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:27:42+00:00 2026-05-26T01:27:42+00:00

I am analyzing an algorithm and I just want to know if I am

  • 0

I am analyzing an algorithm and I just want to know if I am on the right track.

For this algorithm, I am only counting the multiplications on the line which have *** in them.

Here’s the algorithm:

enter image description here

  1. So I am starting from the inner most line, I can see there are 2 operations there (the two multiplications).
  2. Now I am looking at the 2 inner most loops, so I can tell that the p=p*20*z gets executed exactly (j) + (j-1)+(j-2)+(j-3)...1 times. This happens to be equal to j(j+1)/2.
  3. So in total, since there are two multiplication, it happens 2 * (j(j+1)/2).
  4. Then finally, the “i” loop happens exactly n times, so, in total, it’s n(2 * (n(n+1)/2)).

That’s my thought process behind this. Am I correct? Thanks.

  • 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-05-26T01:27:43+00:00Added an answer on May 26, 2026 at 1:27 am

    Your thought process is correct. You need to replace the j term with an n (n being the largest value j can assume), but that is probably a typo.

    Furthermore, you can simplify further from where you are:

    n(2*(n(n+1)/2))
    2*n*(n^2+n)/2
    n^3+n^2
    
    => O(n^3)
    

    The last step is because the n cubed term will grow at a much larger rate than the n squared term we can say it will dominate the runtime for large n. Only other point I would mention is that you should perhaps consider the store to p as an operation as well as the two multiplication, although obviously this will not change the simplified big-o runtime.

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

Sidebar

Related Questions

I was analyzing Javascript codes and came across this line: var date = (new
I'm analyzing an image which takes some time and meanwhile I want to display
Analyzing the location.hash with this simple javascript code: <script type="text/javascript">alert(location.hash);</script> I have a difficult
I have an application in which I am analyzing a system where there are
I am working on a community detection algorithm for analyzing social network data from
I am analyzing a .dmp file that was created and I have a call
I am interested in analyzing balance sheets and income statements using R. I have
Im having a problem analyzing this method. Im trying to figure out the big
Based on this original idea, that many of you have probably seen before: http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
Currently I am loooking for a way to develop an algorithm which is supposed

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.