3 ms·
Stack – JavaScript Implementation
- Dx2m8zHX 11y agoSorry, but http://codetunnel.com/9-javascript-tips-you-may-not-know/#stack http://codetunnel.com/9-javascript-tips-you-may-not-know/#st...
- kevinhack 11y agoI need to limit the size of the stack and I want to remove the bottom-most element of the stack before pushing the new element to the top-most position of the stack if the stack has reached the max size. I think if I use the traditional array, it will be very slow because you need to spend a lot of time on moving, so I finally decide to write my own stack implementation using linked-list.
- kevinhack 11y agoBut because I'm not very familiar with Javascript, so I don't know if my thought is wrong or not. So, If this thought is wrong, please tell me. Thanks.