## [Solved] Big O, how do you calculate/approximate it?

I’ll do my best to explain it here on simple terms, but be warned that this topic takes my students a couple of months to finally grasp. You can find more information on the Chapter 2 of the Data Structures and Algorithms in Java book. There is no mechanical procedure that can be used to … Read more

## [Solved] Big O Of Mod 20

Assuming that you can insert integers of any size, the complexity will be the same as the complexity of division. So it is O(log n) due to log n is the number of digits. Notice 1: If you can only insert 32 or 64 bit integers, the “complexity” will be O(1). Notice 2: Since computers … Read more

## [Solved] Prove that (log n)! = O(n^k)

n^k = (e^k)^log n and the factorial grows faster than an exponential (product of growing factors vs. product of constant factors). 1 solved Prove that (log n)! = O(n^k)

## [Solved] time complexity for given scenario of code [closed]

i): The outer loop is running n times so you touch every element n times in the outer loop. The inner loop is also running n times, so you touch every element n*n times so its O(n^2) ii) The loop is running n*n times so it simply is O(n^2) solved time complexity for given scenario … Read more

## [Solved] What’s the time complexity of T(n) = n⋅log(n) + T(n-1)? [closed]

T(n) = n log n + (n-1) log (n-1) + … + 1 log 1 + T(0) < n log n + (n-1) log n + … 1 log n + T(0) = ( n + n-1 + n-2 + … + 1) log n + T(0) = n(n+1)/2 ⋅ log n + T(0) So … Read more

## [Solved] Can someone tell me the Complexity of the Addition & Subtraction for the Divide & Conquer Matrix Multiplication algorithm?

Can someone tell me the Complexity of the Addition & Subtraction for the Divide & Conquer Matrix Multiplication algorithm? solved Can someone tell me the Complexity of the Addition & Subtraction for the Divide & Conquer Matrix Multiplication algorithm?

## [Solved] 3SAT solved in polynomial time?

In the 3-Sat in CNF all clauses are OR-clauses and they are combined by AND. So the two lines you cite define the following two clauses x5 or x17 or x19 (not x5) or (not x17) or (not x19) which can both be satisfied, for example, by setting x5 to true, x17 to false, and … Read more

## [Solved] what is the best-case / worst-case analysis for the following loop? [closed]

There will be exactly n iterations of the first loop. There will be exactly n(n+1)/2 iterations of the second loop. Inside of the second loop there is roughly 1/3 of n/2 long loops, 1/3 of j long loops and 1/3 of 2 long loops. If we look only at the first of the three possible … Read more

## [Solved] Figuring out the complexity of the code

f(N) is the sum of all integers which are less or equals to N. f(N) = N + f(N-1) = N + N-1 + N-2 + … + 2 + 1 = N*(N+1) / 2 0 solved Figuring out the complexity of the code