We've learned many different types of sorts such as selection, merge, quick etc. Each sort is efficient for different types of data structures. For example, insertion sort is extremely efficient for data structures which are already sorted in ascending order, but terribly inefficient for data which is sorted in descending order. We've also learned about time complexity which is usually expressed using big O notation which excludes coefficients and lower order terms. For example, if the time required by an algorithm on all inputs of size n is at most 5n3+3n, the time complexity would be express as O(n^3). Time complexity is usually estimated by counting the number of steps which is taken by the algorithm.
No comments:
Post a Comment