-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Add deque for JavaScript and typescript #267
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do js and ts doesn't provide built-in Deque? If so, please implement Deque using Linked List, because the popFront()
is slow if implementing Deque using Array.
OK. I would change the implementation |
Or implement it using circular array (a little more complicated than using linked list). |
Hi, we've added I think you can directly use Array as the built-in deque in JS and TS, and add a comment to reveal O(n) time complexity for the |
1 similar comment
Hi, we've added I think you can directly use Array as the built-in deque in JS and TS, and add a comment to reveal O(n) time complexity for the |
Fine. I've enjoyed my Spring Festival vacation recently. I just returned to the city where I live today.
If I have no idea to implement Deque, I will refer to |
Wait, It means i can use the Array to implement the deque and comment the time complexity? @krahets |
@krahets hey, I've commented the time complexity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Please address the comments.
hey, I've fixed all. @krahets |
please check again @krahets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Now merge it.
I recommended turning on the option "Allow edit by the ..." so I can fine-tune this PR.
Moreover, could you help implement |
Please found the finetuned code at 7d0d3df |
Of course, my pleasure!
…---Original---
From: "Yudong ***@***.***>
Date: Sat, Feb 4, 2023 14:56 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [krahets/hello-algo] Add deque for JavaScript and typescript (PR#267)
Moreover, could you help implement linkedlist_deque.js / ts as well?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
If this PR is related to coding or code translation, please fill out the checklist.