Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me, the functions mentioned above are given (C#). They provide the array to the problem and the problem find the highest and longest

Please help me, the "functions mentioned above" are given (C#). They provide the array to the problem and the problem find the highest and longest consecutive streak of integers. If the array provided isn't consecutive (ex: 1,2,3 is the input) the result would be 1. If the array provided is empty or null, return null.image text in transcribedimage text in transcribed

Using the functions mentioned abave develop a routine that finds the ongest consecurive requence of integers shouid two integer values have consecutive sequences of the same length the sequence composed of greater values wouild be the result see example 2) Example 1 Consider the set (d 2.3 3, 3,3 45 5 5 the resuit would he 913 3 3 Example 2 Consider the set /1. 2, 5 5 5 4 4.4 even thoug thee ae consecutive sequences composed of ssand t'sof length 3 the result should be the seqvence composed of greater values therefore the result is be is s5k Debug Team Tools Architecture Test R Tools Analyze WindowHelp ug Any CPU Lab3 nitTestl.cs Program.cs Lab3 ConsoleApp2.Program 6references I cklaes, 2 days ago | 2 authors, 2 changes : public static int? GetNumber) 16 17 18 19 20 21 : int x string a (Console.ReadLine()) :if (int.TryParse(a, out x)) return x else return null; 23 24 25 :4 references | 2/2 passing I cklaes, 2 days ago 1 2 authors, 2 changes 26 27 28 public static int[] GetArray int loc , value, num; int[] nums; int? proof, length -GetNumber) while (lengthnull) 31 32 length GetNumberO: if (length e) return null 34 35 36 S 37 38 39 E 40 41 42 E 43 else int len length?? default(int); nums new int[len] for (value - ; value

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions