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

Android RxJava in 5 minutes

Web Scraping Multiple Webpages of a Website

Using a Web API in Rails

Last Palindromic Date — Puzzle for Interview rounds

My Internship at LetsGrowMore

The Big Game — but Bob and Alice just don’t trust each other or, in fact, anyone: The Mental Poker…

Introduction to Git and GitHub

Misunderstanding to a Cross-Functional Team in Scrum

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

1. Two Sum — LeetCode(Python)

Merge k Sorted Lists 🐫

[Leetcode] Intersection of Two Arrays II

Roman to Integer — Leetcode #13