This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Big-O

 
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is time complexity of a code segment the same as Big-O of it?
 
Saloon Keeper
Posts: 5880
147
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the most part, yes. You also use big-O notation for space complexity (memory) or other complexity measures you can think of, but the most common use by far is for time complexity.
 
Saloon Keeper
Posts: 10782
230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are related but different terms.

"Time complexity" is a rather vague term and can refer to different things. For instance, there is "worst case time complexity", "best case time complexity" and "average case time complexity". Big O can be used to express an upper bound on any of these. If you don't explicitly state what case Big O expresses an upper bound for, people will assume Big O means "upper bound to the worst case time complexity".
'
You can also use Big O to express an upper bound to space complexity for a specific case. You can use Big Omega to express a lower bound on either time or space complexity for a specific case.
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!