473,498 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recurrence problem

5 New Member
There are two integer lists: V(1..N) and W(1..N)
V(i) is positive and W(i) is non-negative for all i. (i.e. W(i) can be
zero)

Now I'm going to select the elements from the V list, the constraint
is : if I pick V(i), then I must avoid taking V(i+1),V(i+2),..., V( i+
W (i) )

The problem is how to maximize the sum of the V's I can select.

Can anyone help me out by using a recursive way, please? Thanks a lot!!!
Oct 29 '07 #1
3 1673
weaknessforcats
9,208 Recognized Expert Moderator Expert
Are you able to solve this by using a loop??

All recursions can be replaced by a loop.

I suggest to get a loop working and then convert the loop to a recursive function. The condition check in the loop will migrate to the recursive function.
Oct 29 '07 #2
tonnyspain
5 New Member
Hi,

thanks a lot for your help!

But I don't quite understand your suggestion yet, would you mind giving more detail? pseudo-code would be help.

Thanks a lot again!!

Regards,
Tonny
Oct 29 '07 #3
tonnyspain
5 New Member
I think I got the recursive formula already. Thanks anyway!
Oct 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3045
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
3729
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
2009
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
117
7099
by: Peter Olcott | last post by:
www.halting-problem.com
28
5168
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
3784
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
3
3982
by: Sir Cactus | last post by:
I'm trying to make my VB read my outlook Calendar, and show me my todays tasks. The connection is no problem and I have a collection of items with all my calendar items... The problem is to decide...
16
4865
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
4529
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.