-
0-1背包问题
给定N中物品和一个背包。物品i的重量是Wi,其价值位Vi ,背包的容量为C。问应该如何选择装入背包的物品,使得转入背包的物品的总价值为最大。
在选择物品的时候,对每种物品i只有两种选择,即装入背包或不装入背包。不能讲物品i装入多次,也不能只装入物品的一部分。因此,该问题被称为0-1背包问题。该算法中,矩阵c的大小为(m+1)×(n+1),物体的重量、价值和解向量大小都等于物体个数n,故该算法的空间复杂度为O(nm)。对物体重量、价值的初始化(算法实现略)所需时间都为n,解向量和矩阵第0行初始化时间为n,矩阵第0列初始化时间为m,对矩阵c的计算所需时间为n×m,解向量X的确定时间为n,故整个算法的时间复杂度为O(nm)。
- 2022-01-25 23:07:45下载
- 积分:1
-
求阶乘算法(0
求阶乘算法(0---10000)标准C++语言控制台应用程序 可能很多人都曾经想过要实现一些比较大的数的阶乘,但是C++中提供的标准数据类型其存储空间太小,根本无法实现。我们可以通过其他方法来实现,本程序用一个很简单的算法实现数的阶乘,程序很短,也很简单,各处都有注释,相信大家很容易就可以看懂,下载源码后在VC6.0中打开编译后即可运行,程序经少许改动可以实现更大的数的阶乘,有兴趣的读者在看完本程序后可一动手试试,其乐无穷!!希望这个程序能给大家一点帮助-The arithmetic for counting factorial(0-10000)
This is a standard C++ language console application, many people could want to relize the factorial of some large numbers, but the memory space of the standard data type provided by the C++ is too small, so it can not realize at all. But we can realize it by other method, the program realize the factorial of the number you give by a simple arithmetic ,this is a short and easy program, and there are remarks everywhere, I believe that everyone can easily understand it, after downloading the sound code you can open it in VC6.0, then edit and run it. you also can change something to realize the factorial of a larger number, the reader who is interesting in it can have a try, there are more happiness in it!! At last,
- 2023-02-22 10:45:03下载
- 积分:1
-
evc写的wince下的串口通信,已经测试通过,希望对大家有用
evc写的wince下的串口通信,已经测试通过,希望对大家有用-evc wince written by the serial communication has been through the testing, it may be useful to hope
- 2022-07-26 16:06:40下载
- 积分:1
-
关于数据库的实例程序
开发环境vc6。0 具体实例 业务管理系统...
关于数据库的实例程序
开发环境vc6。0 具体实例 业务管理系统-examples of database development environments vc6. 0 specific examples Operations Management System
- 2022-08-11 03:08:43下载
- 积分:1
-
一个有关文档操作的好入门程序
一个有关文档操作的好入门程序-a document on the operation of a good entry procedures
- 2022-02-06 05:42:34下载
- 积分:1
-
American Option Pricing in Variance Gamma using Finite Difference
American Option Pricing in Variance Gamma using Finite Difference
- 2022-09-24 05:50:03下载
- 积分:1
-
求闰年的算法,具体请详细阅读文本中算法,绝对没有错。课直接复制上VC运行...
求闰年的算法,具体请详细阅读文本中算法,绝对没有错。课直接复制上VC运行-Seeking a leap year algorithm, please read the text of a specific algorithm, is absolutely not wrong. VC running on a direct course to copy
- 2023-08-28 12:05:03下载
- 积分:1
-
p2p 点对点传输listener java实现,包括源码科编译后的可执行代码...
p2p 点对点传输listener java实现,包括源码科编译后的可执行代码-p2p peer-to-listener java implementation, including the source code section compiled executable code
- 2023-01-04 08:30:03下载
- 积分:1
-
dll import,Load Library操作使用,GetProcAddress操作使用
dll import,Load Library操作使用,GetProcAddress操作使用-dll import, Load Library operational use, GetProcAddress operational use
- 2022-10-01 04:35:02下载
- 积分:1
-
桌面时钟
使用vs编辑器和GDI+技术绘制动态时钟,可以看到不同窗体之间的数据传递和GDI+的使用方法。
- 2022-02-26 02:19:15下载
- 积分:1