Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala version. #23

Merged
merged 5 commits into from
Jun 7, 2017
Merged

Scala version. #23

merged 5 commits into from
Jun 7, 2017

Conversation

rubenrua
Copy link
Contributor

No description provided.

def power(t: List[Int]): List[Int] = {
@annotation.tailrec
def pwr(@specialized t: List[Int], @specialized ps: List[Int]): List[Int] = {
if (t.isEmpty) ps
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if ps contains zero.

2nd version
------------

Array with 303 records: elapsed time = 1422ms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isto é correcto? No peor caso posible? :-o

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No es el peor caso :(

Add a custom optimizated function to get generateAllSubArrays.
@rubenrua rubenrua changed the title WIP Scala version. Scala version. May 19, 2017
@rubenrua
Copy link
Contributor Author

Pongamos a trabajar a la CPU para solucionar el peor caso posible.

Me gustaría probarlo en un i7.

@antonmry
Copy link
Member

Que boa pinta​! Aproveitando que estou ca especialización de Coursera tentarei executalo no meu.

@tomasalmeida
Copy link
Contributor

qué tengo que hacer?

:P

about_this_mac

@rubenrua
Copy link
Contributor Author

sbt run y esperar.

@antonmry
Copy link
Member

antonmry commented May 19, 2017

¡36!. ¡Moi ben @rubenrua !.

Xa vin que na segunda semán do primeiro curso hai un exercicio moi parecido (o de devolver o cambio), non sei se o resolviste así (recursivo con tail e head)... en calquera caso, 👏

Array with 30 records: elapsed time = 3621ms
Array with 31 records: elapsed time = 7358ms
Array with 32 records: elapsed time = 14701ms
Array with 33 records: elapsed time = 29842ms
Array with 34 records: elapsed time = 58502ms
Array with 35 records: elapsed time = 162255ms
Array with 36 records: elapsed time = 240995ms
Array with 37 records: elapsed time = 533864ms
[success] Total time: 1100 s, completed May 19, 2017 4:44:03 PM

A miña CPU: https://gist.github.com/antonmry/ef8ed8815ddf56fd590e5837b42be4b1

@rubenrua
Copy link
Contributor Author

Ufff. Mi portátil se está quedando obsoleto.

@tomasalmeida tomasalmeida merged commit 74a6206 into VigoTech:master Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants