We were given a program and asked to determine the run-time.
I discovered the pattern looks like this: n+(n-1)+(n-3)+(n-5)+...+1.
My only issue is that I forgot how to make this into a formula. Can somebody help with this and also send me a link where they explain this type of work. I forget what this type of math is called so I don't know where to search. Thanks.