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

Lack of a mutable implementation of double linked list #9812

Open
scabug opened this issue Jun 9, 2016 · 2 comments
Open

Lack of a mutable implementation of double linked list #9812

scabug opened this issue Jun 9, 2016 · 2 comments

Comments

@scabug
Copy link

scabug commented Jun 9, 2016

Hi,

In the past, there was a Scala implementation of a mutable double linked list, which has since been deprecated. I'm sure there were good reasons for this at the time, but I strongly believe this is an important data structure to bring into Scala. It is not unusual to need fast insertion or removal at both ends or even just at the end, but where the order matters and it's not ok to build the list in reverse and reverse it when the correct order is needed.

One could argue that in most cases the same result can be achieved by thinking more functional, however there are cases where this would be at the cost of performance. Additionally, to me Scala is a language that does not enforce a particular paradigm on the programmer, so it should be possible for a Java guy to write an algorithm in Scala the same way he would have written it imperatively, without having to massively rework and reoptimize the algorithm.

I'm creating this issue so that relevant people can (re-)evaluate the possibility of introduce back an implementation for this data structure.

@scabug
Copy link
Author

scabug commented Jun 9, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9812?orig=1
Reporter: David Courtinot (Dici)

@scabug
Copy link
Author

scabug commented Nov 14, 2016

@ruippeixotog said:
I agree a mutable double linked list is a good collection to have in a standard library. I'm willing to work on a full implementation (i.e. without relying on List or other existing collection) with Java-level performance if more people agree with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant