☁️정리/❄️자료구조

[자료구조] Priority Queue

뿌야._. 2023. 7. 2. 23:08

Priority Queue 란?


  • 일반적인 Queue의 구조를 가지면서 우선순위가 높은 데이터가 먼저 나가는 구조이다

 

 Priority Queue 선언



import java.util.Collections;
import java.util.PriorityQueue;

public class Main {

	public static void main(String[] args) {

		PriorityQueue<Integer> queue1 = new PriorityQueue<>();
		PriorityQueue<Integer> queue2 = new PriorityQueue<>(Collections.reverseOrder());

	}
}

'☁️정리 > ❄️자료구조' 카테고리의 다른 글

[자료구조] TreeMap  (0) 2023.06.19
[자료구조] 트리 순회  (0) 2022.03.07
[자료구조] 해시 테이블  (0) 2021.10.22
[자료구조] Queue  (0) 2021.09.28
[자료구조] Stack  (0) 2021.09.28