I\'ve got a homework question that\'s been puzzling me. It asks that you prove that the function Sum[log(i)*i^3, {i, n}) (ie. the sum of log(i)*i^3 from i=1 to n) is big-theta (log(n)*n^4).
We just started learning big-o in class. I understand the general concept that开发者_StackOverflow f(x) is big-o of g(x) if there exists two constants c,k such that for all x>k |f(x)|<=c|g(x)|. I h
I recently came across a Microsoft Interview Question for Software Engineer. Given an array of positive and negative integers, re-arrange it so that you have positive integers on one end and negative
Most people with a degree in CS will certainly know what Big O stands for. It helps us to measure how well an algorithm scales.
I am currently studying for an exam in Introduction to algorithms, and I came across a question that I can\'t really solve, the question is this: You have an array of n integers, the first m elements
An algorith with size n=100 takes 21 seconds to run. With size n=1000 it takes 31 seconds and with n=10000 takes 41 seconds to run. What is the running complexity?
sum = 0; for(int i = 0; i < N; i++) for(int j = i; j >= 0; j--) sum++; From what I understand, the first line is 1 operation, 2nd line is (i+1) operations, 3rd line is (i-1) operations, and 4t
Is 2(n+1) = O(2n)? I believe that this one is correct because n+1 ~= n. Is 2(2n) = O(2n)? This one seems like it would use the same logic, but I\'m not s开发者_C百科ure.First case is obviously tr
Let\'s say I have a corpus of documents which I want to read one by one and store them in a data structure. The structure will probably be a list of something. That something class will define a singl
I am lost on these code fragments and finding a hard time to find any other similar examples. //Code fragment 1