Order Analysis of Algorithms. Debdeep Mukhopadhyay IIT Madras. Sorting problem. Input: A sequence of n numbers, a1,a2,…,an Output: A permutation (reordering) (a1’,a2’,…,an’) of the input sequence such that a1’ ≤a2’ ≤… ≤an’ Comment: The number that we wish to sort are also known as keys.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Thus, the algorithm indeed sorts and is thus
In the RAM model the total time required is the sum of that for each statement:
The run time is thus a linear function of n
The run time is thus a quadratic function of n