Quiz

Its quiz time, we will have a short quiz.

Short Quiz

1

What is the big-O of the following code?

func fun7(n int) int {
 m := 0
 for i := 0; i < n; i++ {
  for j := 0; j < n; j++ {
    m += 1
  }
 }
 for i := 0; i < n; i++ {
  for k := 0; k < n; k++ {
     m += 1
  }
 }
 return m
}
A)

OO(n4)n^{4})

B)

OO(n2)n^{2})

C)

O(2n)O(2n)

D)

None of the above

Question 1 of 50 attempted

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.