Name: Anonymous 2012-06-12 17:31
Hey /prog/... today the idea of reciting the alphabet backwards came up in conversation, and this led rise to me thinking about the complexity of doing so. Unless one mentally remembers which letter comes before which, trying to get perfect accuracy may end up with the same complexity of printing a linked list string in reverse. The end result is that the time will be equal to the sum of the number of characters and the sum of every other amount of characters before it. In other words, on a normal alphabet, 26 + 25 + 24 + ... + 2 + 1.
What I'm trying to do is simplify this into a Big O notation. At the moment, I've got some awkward formula of O(f(n)) = O(n^2 + f(n-1)), or something like that.
I'm curious to know if anyone knows how to simplify this.
What I'm trying to do is simplify this into a Big O notation. At the moment, I've got some awkward formula of O(f(n)) = O(n^2 + f(n-1)), or something like that.
I'm curious to know if anyone knows how to simplify this.