Im working on some problems on Algorithmic complexities would really love if someone just pointed me in the right direction:
I couple questions:
1.) Prove the following using the formal definition of Big-Oh complexity
a.) Prove that if an algorithm has: simple operations, then its complexity is: <-- honestly i don't know what this is asking .
2.)
for this one the variable 'i' is initialized to 3 and then the length is shifted over by "1" and then in the body the array index is shifted to the "right" and whatever value that is , is assigned to the index? Am I correct if so would that give me the contents of anArray after the loop executes?
3.) This one went way over my head:
Determine algorithmic complexity in terms on n .
How would I even start this ?
it's been a few years since i've done anything like this, but...
1) what the heck is a 'simple operation'? is a loop a simple operation? if so, then you can't, because nested loops can have O(n), O(n^2), O(n^3)... complexity, depending on how deep you have nested loops.
2) this should be easy to test...write some code, run it, and see what happens.
3) I think this is pretty straightforward.
Do you know anything about Big-O notation? do you have a book that talks about it at all?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Do you know of any good material on the web on Algorithms since my book doesnt go too much into it . I would love to sit down and read a whole bunch on this
@fred rosenberger lol I actually figured it out this morning for some reason when you said "this is pretty straight forward" I was like Hmmm and then Eureka!
Sam Acropolis wrote:Do you know of any good material on the web on Algorithms since my book doesnt go too much into it .
I suggest you go to a local college library and look up the subject. There have been zillions of text books on the topic. No need to buy one, just
spend a few hours reading.
expectation is the root of all heartache - shakespeare. tiny ad: