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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:06:36+00:00 2026-06-15T10:06:36+00:00

Is time complexity O(n^2) or O (n(logn)^2) better? I know that when we simplify

  • 0

Is time complexity O(n^2) or O (n(logn)^2) better?

I know that when we simplify it, it becomes

O(n) vs O((logn)^2)

and logn < n, but what about logn^2?

  • 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-15T10:06:37+00:00Added an answer on June 15, 2026 at 10:06 am

    n is only less than (log n)2 for values of n less than 0.49…

    So in general (log n)2 is better for large n…

    But since these O(something)-notations always leave out constant factors, in your case it might not be possible to say for sure which algorithm is better…

    Here’s a graph:

    enter image description here

    (The blue line is n and the green line is (log n)2)

    Notice, how the difference for small values of n isn’t so big and might easily be dwarfed by the constant factors not included in the Big-O notation.

    But for large n, (log n)2 wins hands down:

    enter image description here

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

Sidebar

Related Questions

I know that quicksort has O(n log n) average time complexity. A pseudo-quicksort (which
I recently read about time complexity and I found out that Quick sort has
Hi I want to know what is the time complexity of the replaceAll function
May I know why the time complexity of insertion of skip list is O(log
How to determine time complexity of this code ? I guess that modPow method
I can understand the run time complexity in the algorithm. But just a bit
for an algorithm time complexity analysis i need to know what is the result
Can a map and a min-heap used together give better amortized time that either
Is the time complexity of the Oracle MAX function O(1), O(log n) or O(n)
What is the time complexity of this nifty function 'assoc'?

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.