huihut / interview

📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.
https://interview.huihut.com
Other
34.8k stars 7.97k forks source link

Change Iterative Function - Merge Print and Iterative function #51

Closed shoaibrayeen closed 5 years ago

shoaibrayeen commented 5 years ago

Following the same signature for recursive and iterative functions and passing number of items, size of the knapsack, weights and their values as arguments to recursive and iterative functions.

Merged print function inside the iterative function. As we are passing values to the functions, made all the elements locally( written inside the main function)

Now standard signature would look like

huihut commented 5 years ago

Thank you for your contribution, I agree with your concept, your PR should be merged