Search Header Logo

DSA - Infosys Power Programmer

Authored by Mohd. Imran

Computers

University

50 Questions

Used 2+ times

DSA - Infosys Power Programmer
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the time complexity of computing prefix sum for an array of size n?

O(1)
O(n^2)
O(n)
O(log n)

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the prefix sum of array [2, 4, 6]?

[2, 6, 12]
[2, 4, 6]
[2, 8, 14]
[2, 6, 10]

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How to get the sum of subarray [i..j] using prefix sum array?

prefix[j] - prefix[i]
prefix[j]-prefix[i+1]
prefix[j+1]-prefix[i]
prefix[j+1]-prefix[i+1]

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the prefix sum array of [1, -1, 3, 2]?

[1, 0, 3, 5]
[1, 1, 4, 6]
[1, -1, 2, 4]
[1, 0, 2, 3]

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which operation becomes efficient using prefix sums?

Sorting
Searching
Subarray sum
Rotating array

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In prefix sum, what is prefix[0] typically initialized to?

0
1
First element
None of the above

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If prefix sum array is [3, 7, 12, 20], what is the original array?

[3, 4, 5, 8]
[3, 7, 12, 20]
[3, 10, 5, 8]
[3, 7, 12, 32]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?