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
- Host: GitHub
- URL: https://github.com/zenelhila/data-max-assignment
- Owner: zenelhila
- Created: 2022-04-25T08:42:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-25T08:51:15.000Z (about 4 years ago)
- Last Synced: 2025-02-27T10:59:45.510Z (over 1 year ago)
- Topics: arrays, arraysort, fibonacci-sequence, java, linked-list
- Language: Java
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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