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

Java List is bad teaching #46

Open
yecril71pl opened this issue Mar 18, 2022 · 0 comments
Open

Java List is bad teaching #46

yecril71pl opened this issue Mar 18, 2022 · 0 comments

Comments

@yecril71pl
Copy link

yecril71pl commented Mar 18, 2022

If you implement Java List using arrays, you get long insert/delete. If you implement it using lists, you also get long insert/delete, so it buys you nothing. Arguing that a list is somehow better than an array in this context is simply misleading the learners. (Actually, arrays should be quicker because of HW acceleration and better locality.)
BTW, what you need here is an implicit treap. But that is not a standard collection and you should provide it yourself as a data structure for this task.

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

No branches or pull requests

1 participant