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

Stack 2개로 Queue 구현하기 #6

Open
dididy opened this issue Mar 11, 2021 · 1 comment
Open

Stack 2개로 Queue 구현하기 #6

dididy opened this issue Mar 11, 2021 · 1 comment
Assignees

Comments

@dididy
Copy link
Member

dididy commented Mar 11, 2021

WIP

@dididy dididy self-assigned this Mar 11, 2021
@dididy
Copy link
Member Author

dididy commented Mar 11, 2021

장점

JavaScript의 경우 list에서 shift 메서드로 dequeue처럼 사용할 수 있다. 이 경우 O(N)의 시간복잡도를 가진다.

만약 list를 Stack처럼 2개를 사용하여 Queue를 구현하게 되면 dequeue할 때 O(1)의 시간복잡도일 것이다. 이것이 장점 중 하나라고 유추했다.

아직 정확한건 모르겠다. 면접에서 어떻게 대답해야할까?

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