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 8481567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:35:28+00:00 2026-06-10T19:35:28+00:00

For the given code (I am using just one from my previous questions), the

  • 0

For the given code (I am using just one from my previous questions), the running time using O notation is O(n^2). If I want to express the running time using Theta notation would it be the same? Meaning Theta(n^2)?

for(int i=0; i<N; i++){
   for(int j=1; j<N; j++){

    System.out.println("Yayyyy");
    if(i<=j){
        System.out.println("Yayyy not");
    }
}
}
  • 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-10T19:35:29+00:00Added an answer on June 10, 2026 at 7:35 pm

    In essence:
    Big O-notation is for UPPER bounds for running time. This means that most algorithms have several Big O-bounds (your algorithm is for example O(n^23) because it is by far more effective than a theta(n^23) algorithm)
    Theta-notation is for tight bounds. Not all algorithms have a clearly defined tight bound, because this would mean that it grows proportionally with the other function. In your example, because there is no way the algorithm can finish without having printed “Yayyy not”
    (n^2 – n)/2 times, and it will never run more than this number of times, it will always grow proportionally with n^2, and thus have a theta(n^2) bound!

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

Sidebar

Related Questions

I'm trying to add infinite scroll functionality to a page using code given in
Ok, here's what I'm trying to do... given this razor code @using(Html.WriteLater()) { output
I have been given some matlab code compiled using the .net compiler. I can
I'm indexing and searching code using a custom analyzer. Given text will wi-fi work,
Given the following lines of code which is using JQTOUCH: $('#customers').bind('pageAnimationEnd', function(e, info){ if
Given such a code segment: #include <iostream> #include <iterator> #include <fstream> #include <string> using
I have a REST API using Django Tastypie. Given the following code The models
I am using vala. This is the source code that gives that compile time
i'm having a problem running an sql in ms-access. im using this code: SELECT
I am calling from one piece of my code through several layers of 3rd

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.