An open API service indexing awesome lists of open source software.

https://github.com/zenelhila/data-max-assignment


https://github.com/zenelhila/data-max-assignment

arrays arraysort fibonacci-sequence java linked-list

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

# 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