Question: Write a method longestepquential sequence that returns the length of the longest sequential sequence within a list of integers. For example, if a variable called

Write a method longestepquential sequence that returns the length of the longest
sequential sequence within a list of integers. For example, if a variable
called list stores the following sequence of values:
1,2,3,2,9,7,-3,0,42,308,17
then the call: 11st. longestsequentialsequenoe () would return the value 3 because
it is the length of the longest sequential sequence within this list (the sequence
1,2,3. If the list is empty, your method should return 0. Notice that for a non-
empty list the method will always return a value of at least 1 because any
individual element constitutes a sequential sequence.
Assume you are adding to the arrayIntList class with following fields:
 Write a method longestepquential sequence that returns the length of the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!