Q. For which of the following inputs would Kadane’s algorithm produce a WRONG output?

  • (A) {1,0,-1}
  • (B) {-1,-2,-3}
  • (C) {1,2,3}
  • (D) {0,0,0}
πŸ’¬ Discuss
βœ… Correct Answer: (B) {-1,-2,-3}
Explanation: kadane’s algorithm doesn’t work for all negative numbers. so, the answer is {-1,-2,-3}.

Explanation by: Mr. Dubey
kadane’s algorithm doesn’t work for all negative numbers. so, the answer is {-1,-2,-3}.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
115
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
97%
Success Rate