go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  How to tell a algorithm is efficient?
 
Subject: How to tell a algorithm is efficient?
Author: Alex_Raj
In response to: How to tell one algorithm is better than another.
Posted on: 12/14/2013 03:27:46 AM

An algorithm is considered efficient if its resource consumption is at or below some acceptable level. There are many ways in which the resources used by an algorithm can be measured: the two most common measures are:

  • Speed, and
  • Memory usage

    Other measures could include:
  • Disk usage
  • Power consumption
  • Total cost of ownership.

    Many of these measures depend on:
  • The size (N) of the input to the algorithm
  • The way in which the data is arranged, which results in so called "worst case scenario", "best case scenario" and "average case scenario".

    For example, QuickSort algorithm is measured as:
    Worst case performance          O(N^2)
    Best case performance           O(NlogN)
    Average case performance        O(NlogN)
    Worst case space complexity     O(N) 
    



     

    > On 12/14/2013 02:46:22 AM Alex_Raj wrote:


    That's simple. Here is the rules:
  • Rule #1: It is accurate, of course
  • Rlue #2: It is more efficient.





    References:

  •  


     
    Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.