<aside> 💡 자료구조란 데이터를 구성하고 저장하는 방법을 설명하며, 데이터를 식별하는 방법을 제공하고 데이터의 관계를 보여주는 개념이다.
</aside>

배열(Array)
리스트(List)
큐(Queue)
스택(Stack)
트리(Tree)
트리


트리 구조란 모든 노드가 연결되어 있으면서 순환할 수 없는 다이어그램을 말한다.
왼쪽은 모든 노드가 연결되어 있지 않으며, 오른쪽은 순환이 가능하기 때문에 트리가 아니다.
정렬 순서

https://m.blog.naver.com/rlakk11/60159303809
코드로 파악해보면 좀 더 이해하기 쉽다.
fun preorder(n) {
visit(n)
preorder(n.left)
preorder(n.left)
}
fun inorder(n) {
inorder(n.left)
visit(n)
inorder(n.left)
}
fun postorder(n) {
postorder(n.left)
postorder(n.left)
visit(n)
}
이진 탐색 트리의 삭제 방법
균형잡힌 이진 탐색 트리

완전 이진 트리(complete binary tree)

힙
트리 기반 데이터 구조이다.
우선순위 큐는 힙을 이용해 구현할 수 있다.
힙 데이터 구조는 힙 메모리와 전혀 다른 개념이다.
힙이란 완전 이진 트리에서, 루트 노드가 가장 큰 값 또는 가장 작은 값을 가지고 있는 경우를 말한다.
최초로 생성할 때는 $O(n)$, 추가나 삭제의 경우 $O(logN)$ , 탐색의 경우 $O(1)$ 의 시간복잡도를 갖는다.
하지만 힙은 삭제는 반드시 루트 노드만 가능하다는 점을 명심해야 한다.
k번째로 큰 노드를 찾는 것도 불가능하며, 루트 노드(최댓값)을 뺀 나머지 요소는 알 수 없는 구조라고 생각하면 좋다.
따라서 무작위 값이 추가되면서, 최댓값, 최솟값의 탐색 및 삭제만 필요한 상황에서 유용한 구조이다.
힙의 삽입 로직
function insert(arr[], n, x)
arr.append(x) // Add node x at the end.
set i = n + 1 // Start from the last node.
while i > 1 and arr[i / 2] < arr[i] // If the parent is smaller than the child,
// it violates the max-heap condition.
swap(arr[i], arr[i / 2]) // Swap the two values
i = i / 2 // Move up to the parent position.
힙의 삭제 로직
function remove(arr[], n)
arr[1] = arr[n] // Move the last node to the first node.
delete arr[n] // Delete the last node.
heapify(arr, n - 1, 1) // Perform heapify starting from the 1st node
// to maintain the max-heap state.
해시(Hash)
그래프(Graph)
자바 자료구조의 모든것
API reference for Java Platform, Standard Edition
Java Development Kit Version 17 API Specification
Java Development Kit Version 17 API Specification
개요

https://medium.com/@dakota.lillie/javas-collections-framework-an-overview-86de12f4f622