Create Quiz

Maximum profit by buying and selling a share at most twice Quiz

Maximum profit by buying and selling a share at most twice Quiz

One transaction consists of buying the stock on a given day and selling it on another, later day. Write a function that returns the maximum profit that you can gain quiz

You can mute/unmute sounds from here

You May Get Result Of Maximum profit by buying and selling a share at most twice Quiz

Maximum profit by buying and selling a share at most twice Quiz
Maximum profit by buying and selling a share at most twice Quiz
Maximum profit by buying and selling a share at most twice Quiz
Maximum profit by buying and selling a share at most twice Quiz
POST YOUR ANSWER (READ ANSWERS)

Quiz Questions And Answers

In divide and conquer, the time is taken for merging the subproblems is?

O(N)
O(N log N)
O(N2)
O(log N)

The optimal time obtained through divide and conquer approach using merge sort is the best case efficiency.

true
false

Which of the following strategies does the following diagram depict?

Brute force
Divide and conquer
Exhaustive search
Branch and bound

Which of the points are closer to each other?

p1 and p11
p3 and p8
p2 and p3
None

What is an in-place sorting algorithm?

It needs O(1) or O(logn) memory to create auxiliary locations
The input is already sorted and in-place
It requires additional storage
None

In the following scenarios, when will you use selection sort?

The input is already sorted
A large file has to be sorted
Large values need to be sorted with small keys
Small values need to be sorted with large keys

What is the worst case complexity of selection sort?

O(nlogn)
O(logn)
O(n)
O(n2)

What is the optimal time required for solving the closest pair problem using divide and conquer approach?

O(N)
O(log N)
O(N log N)
None
ANSWERS

Currently, we have no comments. Be first to comment on this quiz.

Maximum profit by buying and selling a share at most twice Quiz : Test Trivia

Ultimate impossible accurate personality honest Quiz Game

How do you rate this quiz?

Average rating 4.8 / 5. Vote: 5
Embed This Quiz
Copy the code below to embed this quiz