Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

oms3.net/mod/hsuforum/discuss.php?d 212685 GLISH-UNITED STATES (EN-US) Algorithm

ID: 3878550 • Letter: O

Question



oms3.net/mod/hsuforum/discuss.php?d 212685 GLISH-UNITED STATES (EN-US) Algorithm Attributes Discussion Forum 38 days ago 7 replies Last 2 hours ago Discuss the attributes that make certain algorithms better than others For each attribute, comment on whether it is required or optional whether how it can be precisely quantified - how it can be used to select among alternative algorithms for a given problem Reply 7 replies Post by Jack Bainter t day ago Correctness, efficiency, ease of understanding, and elegance are the main attributes of an algorithm. Correctness is required, not optional. A real algorithm must "give a result then halt,"by formal definition (Schnelder & Gersting 2015). With most algorithms, mathematics can be preformed to ensure the algorithm is resulting in a correct output. The

Explanation / Answer

In an algorithm, there are two factors that matter the most besides the fact that the algorithm works correctly, that is, yields the output desired:

1. Time complexity- The time complexity is defined as the time taken by an algorithm to run. We wouldn't want to wait for hours and hours to wait for a piece of code to give an output. The time complexity of an algorithm is usally calculated based on the input size. for example:

array a[1...n]

For(i = 1 to n)

sum= sum+a[i] //This piece of code runs for n times

So, this is a way how the time complexity of the algorithm is calculated. Also, they can be classified as best case time, average case time and worst case time.

2. Space complexity- This plays a major role to ensure that the algorithm is not using up all the space. By space we mean memory. We do not want the algorithm to be such that it uses up all the memory and there is nothing left for it to work on. Therefore, it is an essetial part of algorithm design.