큐4 [Lv.2] 프린터 첫 설계 방법이다. 이대로 설계하니, 다행스럽게도 통과는 하였다. 다른 분들의 풀이를 보고 나니 더 쉽게 할 수 있었다. 우선 내가 풀이한 코드이다. package Lv_2; import java.util.*; public class lv2test { public static int solution(int[] priorities, int location) { List result = new ArrayList(); List result_idx = new ArrayList(); LinkedList pq = new LinkedList(); LinkedList idx = new LinkedList(); for (int i = 0; i < priorities.length; i++) { pq.add(prioriti.. 2023. 2. 19. Queue Queue 정리보기 2021. 6. 28. Stack / Queue 스택과 큐에 대하여 개념정리를 해보려고 했다.. 나는 잘 모르기때문에 검색해서 알아보려고 했는데...? 홀리? 코딩팩토리님 페이지에 정말...잘 정리해놓으셨다 ㅎㅎ... 굳이 내가 이것저것 짜집기 해서 엉성하게 정리해놓는거 보다는.. 가서 보는게 좋을거같다. Stack이란? - 코딩팩토리 페이지로 이동! Queue란? -코딩팩토리 페이지로 이동! 2021. 1. 14. Stack/Queue - Level 2, 주식가격 어렵다..난 이렇게밖에 못하겟던데.. 스택이나 큐를 이용해서 풀어야한다.. import java.util.*; class Solution { public int[] solution(int[] prices) { int[] answer = new int[prices.length]; int count = 0; for(int i=0; i 2021. 1. 14. 이전 1 다음