aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Data Structures and Algorithms Fundamentals
  • Given two arrays of numbers a1,..........., an and b1,......
Multiple choice

Given two arrays of numbers a1,..........., an and b1,............, bn where each number is 0 or 1, the fastest algorithm to find the largest span (i, j ) such that ai + ai+1 + .........+ aj = bi + bi + 1 +...........+ bj is:

  1. O(n2)

  2. O(n3)

  3. O(nlogn)

  4. O(2n)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

null

Keep practicing — related questions

  • Given two arrays of numbers a1,..........., an and b1,............, bn where each number is 0 or 1, the fas...
  • Given two arrays of numbers a1,..........., an and b1,............, bn where each number is 0 or 1, the fas...
  • If I am given a list of numbers, what will be the best time complexity to find out the maximum number from ...
  • An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array $A[...
  • What is the best possible running time of the code to sort a list of n numbers given the maximum number (k)...
  • Given array of elements [50 60 30 40 20 15 25]. In how many comparisons, 4th largest item can be found if B...
  • Let w(n) and A(n) denote respectively, the worst case and average case running time of an algorithm execute...
  • What will be the output of the program? class A { final public int GetResult(int a, int b) { return 0; } } ...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy