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

[Week 16] BOJ 자료구조 2 - 3문제 완료 #69

Merged
merged 3 commits into from
Jun 12, 2023

Conversation

jinny-l
Copy link
Member

@jinny-l jinny-l commented Jun 5, 2023

  • 아직 문제만 보고 시간복잡도 바로 계산이 어려워서 일단 풀어보고 시간초과하면 다른 방법을 찾아보는 것 같습니다.
  • 문제를 보고 어떤 자료구조를 사용할지 판단할 수 있도록 시간복잡도 계산에 익숙해져야 하겠습니다.

* 처음에 ArrayList로 풀었는데 시간초과가 안나서 우선순위 큐로도 한번 더 풀었다.
* 최대 힙, 최소 힙을 구현한 두개의 우선순위 큐로 풀면 remove() 메서드로 인해 시간초과가 난다.
* TreeMap은 흑적나무로 구현되어 있어서 양쪽 끝단의 숫자를 O(1)로 꺼내올 수 있다.
* 다른 풀이로는 두개의 HashMap에 [이름, 인덱스], [인덱스, 이름]을 저장하는 방법이 있겠다.
* 또 다른 풀이로는 한개의 HashMap에 [이름, 인덱스], [인덱스, 이름]을 문자열 형태로 두 번 저장하는 방법이 있겠다.
* 숫자 or 문자열 여부를 판단하는 방법이 조금 고민되었다.
@jinny-l jinny-l added the BOJ label Jun 5, 2023
@jinny-l jinny-l merged commit b0a60d4 into CodeSquad-2023-BE-Study:main Jun 12, 2023
@jinny-l jinny-l deleted the week16 branch July 19, 2023 10:32
Gwonwoo-Nam pushed a commit to Gwonwoo-Nam/Algorithm-Study that referenced this pull request Jul 26, 2023
* ✨feat: BOJ_2075_N번째_큰_수 알고리즘 구현

* 처음에 ArrayList로 풀었는데 시간초과가 안나서 우선순위 큐로도 한번 더 풀었다.

* ✨feat: BOJ_7662_이중_우선순위_큐 알고리즘 구현

* 최대 힙, 최소 힙을 구현한 두개의 우선순위 큐로 풀면 remove() 메서드로 인해 시간초과가 난다.
* TreeMap은 흑적나무로 구현되어 있어서 양쪽 끝단의 숫자를 O(1)로 꺼내올 수 있다.

* ✨feat: BOJ_1620_나는야_포켓몬_마스터_이다솜 알고리즘 구현

* 다른 풀이로는 두개의 HashMap에 [이름, 인덱스], [인덱스, 이름]을 저장하는 방법이 있겠다.
* 또 다른 풀이로는 한개의 HashMap에 [이름, 인덱스], [인덱스, 이름]을 문자열 형태로 두 번 저장하는 방법이 있겠다.
* 숫자 or 문자열 여부를 판단하는 방법이 조금 고민되었다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant