Merged
Conversation
Collaborator
|
코테 아직 왕초보인데 보면서 많이 배웠습니다 수고하셨어요!! 💪🏻 |
JooKangsan
approved these changes
Jan 16, 2025
Collaborator
JooKangsan
left a comment
There was a problem hiding this comment.
수고하셨습니다!! 해설 다 읽어봤는데 스택 주차이다 보니 스택에 관해서 의도적으로 사용한 부분들이 눈에 보였습니다!! 수고하셨어요!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[스택]
스택의 ADT
boolean isFull()boolean isEmpty()void push(ItemType item)ItemType pop()Int topItemType data[maxsize]data배열의 최대 크기는maxsize⇒ 인덱스의 범위는0부터maxsize-1top은-1top이0이면 데이터가1개 있다는 것스택의 세부 동작
push(3)isFull()을 우선 수행 ⇒data배열에 데이터가 가득 찼는지 확인top을 1만큼 증가시킨 후 (top = -1→top = 0)top이 가리키는 위치data[0]에 3을 추가pop()isEmpty()를 우선 수행 ⇒data배열에 데이터가 없는건 아닌지 확인top을 1만큼 감소시키고스택 구현하기
자바스크립트의 내장 메서드 사용
📌 푼 문제
[기초]
[중급]
[심화]
📝 간단한 풀이 과정
문자열 뒤집기 / 기초
컨트롤 제트 / 기초
문자열 계산하기 / 기초
my_string을split하여 배열로 변환했습니다.stack에는expression의 가장 첫번째 요소 (무조건 숫자임)를 넣어 초기화해줍니다.expression에+나-가 나오면stack에push합니다.숫자가 나오면 바로 전의operator와 그 앞에 들어있는 숫자를stack에서 꺼내어 더하기 또는 빼기를 수행합니다.stack에 넣어줍니다.크레인 인형뽑기 게임 / 중급
moves를 돌면서item을board에서 하나씩 꺼내stack에 담습니다.stack에 이미 해당item이 들어있다면pop하고answer에2를 더합니다.올바른 괄호 / 중급
stack에 담습니다.stack이 비어있는지 확인합니다.false를 반환합니다.pop()합니다.다트 게임 / 중급
dartResult를 돌면서S,D,T,*,#,숫자가 나오는 경우로if분기처리 했습니다.stack에는 숫자만 남고,stack에 있는 숫자에 거듭제곱과 곱하기를 수행하여 마지막에 숫자들을 더합니다.괄호 회전하기
(i + j) % N으로 회전하는 인덱스(?)를 구할 수 있더라구요.주식 가격
stack에index를 저장했습니다.(개인적으로 이 부분이 헷갈리더라구요)prices를 돌면서 price(의 index)를 stack에 담습니다.stack의 top에 있는 price보다 떨어지게 되면, 그 앞의stack들을 돌면서 price보다 높은 경우의 시간(answer)을 확정합니다.택배 상자
temConv에 넣어두고 나서top과 비교하면 되는 문제였던 것 같습니다.