Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-07-2012, 11:43 AM   #1
Registered: Jan 2012
Location: PUNE
Distribution: SunOS sun4v sparc sun4v Solaris
Posts: 90
Blog Entries: 1

Rep: Reputation: Disabled
Post how to find the time complexity ?

Hi ,

how to find the time complexity of an algorithem and when to consider the O(n) O(n2).... and O(logn) O(n log n)...

Please provide some need full docs or links (url) to understand.

I have googled for it found some information. But, not able to figure it out.

Thanks & Regards,
Old 12-07-2012, 12:03 PM   #2
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Here is an article in wikipedia

I would recommend that you try to understand the subject and then when you have further questions, use the Report-button at your posting and ask a Moderator to move this thread to the "Programming" forum.

Old 12-07-2012, 12:29 PM   #3
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
Originally Posted by rpittala View Post
time complexity of an algorithem and when to consider the O(n) O(n2).... and O(logn) O(n log n)...

MIT Opencourseware includes the 600 course that I can recommend.
Old 12-07-2012, 08:42 PM   #4
LQ Newbie
Registered: Jul 2009
Posts: 14

Rep: Reputation: 0
Its not always simple

To find the complexity of an algorithm can't be done with simple commands or testing the algorithm without understanding the test case and how the algorithm operates. If you were to submit a case of n objects to the algorithm it processes them in "n" time. If you increase this by 2 then it processes in 2N time. The only true way to figure out the complexity is to look at the code. Loops where every "object" that the algorithm is processed is an O(n). You can look for nested loops, if for every object, all n objects are processed, you have an O(n^2). Its very complex and hard to explain, you might want to read the Wikipedia article in full.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script to test string complexity (like password complexity) robertjinx Linux - Server 2 05-12-2010 02:58 PM
Measuring Time Complexity on C++ vxc69 Programming 1 02-18-2008 01:05 PM
password complexity pasupuleti Linux - Security 18 09-24-2006 01:07 PM
password complexity moinpasha Linux - Security 11 09-13-2006 10:53 PM
password complexity moinpasha Programming 1 09-12-2006 05:24 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration