Programming Algorithms Quiz

The following paradigm can be used to find the solution of the problem in minimum time: Given a set of non-negative integer, and a value K, determine if there is a subset of the given set with sum equal to K:

A. Divide and Conquer

B. Dynamic Programming

C. Greedy Algorithm

D. Branch and Bound

Solution :

B) is correct.

Given problem is Subset-sum problem in which a set of non-negative integers, and a value sum is given, to determine if there is a subset of the given set with sum equal to given sum. With recursion technique, time complexity of the above problem is exponential. We can solve the problem in Pseudo-polynomial time using Dynamic programming.

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--

--

Upskilling students for tech placements!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Auto Scaling Kubernetes Clusters Based on GPU Metrics

Shared Preferences

Supersize your SuperSaaS with Integromat

Do NOT Measure Developers — Measure Projects

Unity Log, Stardate: -301753.35251775756 (03/31/2021)

How Flink’s Application Powers Up eBay’s Monitoring System

Submitting Spark Job to Dataproc

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Placewit

Placewit

Upskilling students for tech placements!

More from Medium

Leetcode

Leetcode 1514. Path with Maximum Probability

Learn Queue ausing Java

Selection, Insertion, and Merge Sort