Algorithm needed in any laguage - Related to Arrays -
I have a question where there are four arrays, two for men and two for women. The male array is aging in a growing order and the second array is the height of men in increasing order.
Now if a man marries a woman, then he becomes the age of the man, men on the left side of this man should marry women with women on the left. And the officers of this man should marry women on the right side of this woman.
Example: If the men's age range is {8, 9, 23, 25, 27, 28} .. and women are age arrays {7 9, 12, 20, 28, ...} And if a 27-year-old woman has married a woman from the age of 20, then men 8,9,23,25 should marry women from 7, 9,12.
No matter if they do not get married, but if they marry, then this matter should be a case.
After the marriage, they have children on the basis of height Array, if the difference between couple is difference difference 0 then they have 7 children, if the difference in height is 1-2 then they have 6 children, If the height is 3-4 then they have 5 children, such as the wise if the height is 13 or more then they have 0 children.
So I want an algorithm which can maximize the number of children. I want the maximum number of children
This can be any language, basically I need algorithms.
It looks like a problem.
Ideally, whatever you have entrusted this task, you should not already tell it how to do this kind of content. But if your teacher wants to solve this kind of problem with you blue, then this keyword and link can help you get started.
I will also tell which programming language, if any, you are fluent in. People here (together) know the most programming languages and can make suggestions to understand you the most.
Comments
Post a Comment