LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 12-07-2012, 11:43 AM   #1
rpittala
LQ Newbie
 
Registered: Jan 2012
Location: BANGALORE
Posts: 27

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.
FYI,

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

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

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Here is an article in wikipedia http://en.wikipedia.org/wiki/Time_complexity

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.

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

Rep: Reputation: 192Reputation: 192
Quote:
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.
http://ocw.mit.edu/courses/electrica...ideo-lectures/
 
Old 12-07-2012, 08:42 PM   #4
Adickel
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.
 
  


Reply


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


All times are GMT -5. The time now is 01:24 PM.

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