What is Amortization?
Consider that you are a company owner and that you require a vehicle. The automobile is priced at €10, 000. You’ll have to spend €10, 000 if you decide to purchase it this year. But you want to keep driving the automobile for the next ten years. An additional €1, 000 is needed to operate the automobile for a year.
There are two different angles from which to view the aforementioned circumstance. The first method is the one we employed above: there is a year with a high level of spending followed by nine years with lower levels.
Similarly, in the case of data structure, all of an algorithm’s steps or all of a method’s executions in a data structure typically take the same amount of time. In these situations, determining a suitable upper bound on the time complexity is simple: multiply the number of steps by the longest possible time for a single step.
So basically in upper cases, we can have cases when the price of cars can go up and down. but if we calculate the overall cost it will be the average one. Similarly in data structures, some steps can be costlier but overall steps are minimized.