Suljettu

c# program

Please write program, using the rules given below:

The solution must be written in C#.

You will be given a triangle input (which is a directed graph) and you need to find the path that

provides the maximum possible sum of the numbers per the given rules below:

1. You will start from the top and move downwards to the last possible node.

2. You must proceed by changing between even and odd numbers subsequently. Suppose that

you are on an even number, the next number you choose must be odd, or if you are on an

odd number the next number must be even. In other words, the final path would be Odd ->

even -> odd -> even …

3. You must reach to the bottom of the pyramid.

4. Assume that there is at least one valid path to the bottom.

5. If there are multiple paths, which result in the same maximum amount, you can choose any

of them.

Sample Input:

1

8 9

1 5 9

4 5 2 3

Output:

Max sum: 16

Path: 1, 8, 5, 2

Explanation:

As you can see this triangle has several paths: 1->8->5->2, 1->9->9->3, 1->8->1->4, etc.

The correct answer is 1 + 8 + 5 + 2 = 16. Because since 1 (top most number) is odd we cannot step

onto 9 because 9 is an odd number too. The only number we can move to is 8. From 8 we can step

to 1 or 5. Only 1 -> 8 -> 5 -> 2 sequence gives us the maximum sum. The other path 1-> 8 -> 1 -> 4 is

also a valid path but it sums up to 14. Since 16 is greater than 14, 16 is the solution. Also, note that

the solution is in the form of odd > even > odd > even. Read Less

Taidot: .NET, C# -ohjelmointi

Näytä lisää: write a c program to accept 10 or more numbers then display the numbers in two columns one column with the numbers as they were , write a C program, write a c++ program to accept 10 or more numbers then: display the numbers in two columns: one column with the numbers as they w, write c program online, write c program, write c++ program online, write a c program which can find the root of any function using secanet method, Write a C++ program to assign courses (for final exams) to students such that no student will have two finals scheduled at the s, Write a c# program in the next 30-60 min, write c# program, c program examples with output and explanation, c# program examples with output and explanation, c program to read and write to a file, c program to check whether a number is even or odd using function, how to write c++ program, write a c program to solve the given equation using bisection method, how to write c program in linux terminal, c program to create a file and perform read and write operations, c++ program to read and write a text file, c++ program to find grade of a student using if else

Tietoa työnantajasta:
( 0 arvostelua ) Bengaluru, India

Projektin tunnus: #21922403

17 freelanceria on tarjonnut keskimäärin 1168₹ tähän työhön

carlosperezit

Hi there My name is Carlos and I'm an expert in .Net and sql server. I have been working in software developement for the last 20 years. I have many experience in desktop and web development. Regards

₹4000 INR 7 päivässä
(21 arvostelua)
4.9
youshaarif

Hi, I showed a keen interest in your project as I hold 2 years of experience in C#development, your requirements seem simple and concise to me, and I would love to hear more from you. If it seems feasible feel free to Lisää

₹600 INR 1 päivässä
(8 arvostelua)
3.7
BestPrince1120

Thank u for posting your project. I'm expert in your job. I'm a expert in C ++, C#, I 've taken part in the National ACM Contest in 2016(that was Algorithm contest with C++ ) and win a bronze medal. I have 8 years of Lisää

₹600 INR 1 päivässä
(3 arvostelua)
2.5
asmoljan

Hi I'm experienced programmer c# programmer and I assure you that you will get quality result in the deadline. Best regards Antonio

₹1312 INR 3 päivässä
(1 arvostelu)
0.4
anandsingh12

I can give you the code you needed. I understood the problem as you explained. just award me this I will finish fast and give you the code.

₹1450 INR 1 päivässä
(0 arvostelua)
0.0
jonaro03

Hello, I am a software developer with more than 10 years of experience, I have the skills to perform this task.

₹600 INR 1 päivässä
(0 arvostelua)
0.0
Softwcreative

hello , i can code it.....................................................................................................................................................................................................

₹2000 INR 1 päivässä
(0 arvostelua)
0.0
₹1300 INR 1 päivässä
(0 arvostelua)
0.0
sirisj87

I have 7 years of experience into . Net worked c# and B.V.net. I worked on various projects which includes complex tasks. I can complete your work within deadlines

₹750 INR 7 päivässä
(0 arvostelua)
0.0
Tack261

As a self-taught programmer, I can guarantee you The Project is going to be done on time and I have no need to prove my background. My understanding of the work and time have spent on that, that's what makes people be Lisää

₹600 INR 7 päivässä
(0 arvostelua)
0.0
rvs99

Interesting! Reminded graduation days. Please provide me further details, I can provide brute force solution and optimized one if any. Regards, Rahul Sapkal.

₹1050 INR 1 päivässä
(0 arvostelua)
0.0
aapjansen

When I read this I liked the challenge right away, so I already created a solution that accepts inputs like you specified and displays the required output. Since I have still a lot to learn, I do this kind of projects, Lisää

₹600 INR 1 päivässä
(0 arvostelua)
0.0
Mathanolwin

I have done same problem many times. I can give u optimized answer and i will do it including handling exceptions as much as possible.

₹1250 INR 1 päivässä
(0 arvostelua)
0.0
zamsler

I worked with C# all summer developing projects. I have done similar problems like this throughout my education.

₹1050 INR 7 päivässä
(0 arvostelua)
0.0
₹600 INR 1 päivässä
(0 arvostelua)
0.0
ronituohino

Hello, I can give this a shot! I have about 4 years of experience with C# and I'm familiar with this kind of stuff :) Hit me up!

₹1500 INR 1 päivässä
(0 arvostelua)
0.0
MaratB

Hi! Your requirements seems to be quite easy, I have more than 1 year experience of C# which more than enough for this task, algorithm is also quite simple, I can do it for you. Thanks in advance.

₹600 INR 1 päivässä
(0 arvostelua)
0.0