Improving the Running Time

An easy change to the algorithm improves the running time to O(n2).

Therefore, each iteration of the while loop takes constant time. Total O(n2) time.


next up previous
Next: UNDERSTANDING THE ALGORITHM Up: THE MATCHING ALGORITHM Previous: Time Analysis