zenelhila / Data-Max-Assignment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data Max Assignment

Exercise 1

Given a one-dimensional array, write a function that returns the length of the longest sequence of 1s. The array consists of integers, and it contains only 1s and 0s.

The function receives as input the array.

Example 1:

1 0 0 1 1 1 1

should return 4

Example 2:

1 0 0 0 1 0 1

should return 1

Example 3:

0 0 0 0 0 0 0

should return 0

Example 4:

0 1 1 1 1 1 1

should return 6

Example 5:

0 1 1 1 0 1 1

should return 3

Exercise 2

What are the differences between linked lists and arrays?

(Optional) Exercise 3

Write a function that returns the n-th fibonacci number. n is provided as input to the function

About


Languages

Language:Java 100.0%