0
7.3kviews
Which are different factors considered for sorting elements?
1 Answer
0
116views
  1. The problem of sorting is a problem that arises frequently in computer programming. Many different sorting algorithms have been developed and improved to sorting fast.
  2. As a measure of performance mainly the average number of operations or the average execution times of these algorithms have been investigated and compared.
  3. Some of the factors to be considered in choosing a sorting algorithm include
  4. The size of the list to be sorted
  5. The programming effort
  6. The number of words of main memory available
  7. The size of disk and tape units
  8. The extent to which the list is already ordered
  9. The distribution of values
  10. It is not possible to say that one sorting algorithm is better than other sorting algorithm. Performance of various sorting algorithm depends on the data being sorted.
  11. The empirical/posterior approach consists of programming the competing techniques and trying them on different instances with the help of a computer.
  12. The theoretical/ mathematical / priori approach consist of determining the quantity of resources needed by each algorithm as the function of the size of the instance considered.
  13. The resources involved are computing time and storage space, with the former being more critical. Hence, when we speak of efficiency of an algorithm we shall simply mean how fast it runs.
  14. Since efficiency depends of size of the instance n we can sya that efficiency is a function of n. Hence,

    Efficiency = f (n)

  15. The advantage of theoretical approach is that it neither depends on the computer being used, nor the programming language, nor even the skill of the programmer.
  16. It also saves time that would have been spent needlessly programming an ineffieient algorithm.
  17. It also allows us to study the efficiency of an algorithm when used on instance of any size.
  18. This is often not the case with empirical approach where practical considerations may force us to test our algorithm on limited instances of modern size.
Please log in to add an answer.