
# 큐 - 큐: 처리를 기다리고 있는 작업(원소)들의 리스트 - 선입 선출(FIFO, First-In, First-Out) 방식 / FCFS (First-Come, First-Served) - 우선순위를 부여하지 않음 - 새로운 원소는 큐의 맨 뒤(rear)에 삽입되고 큐의 맨 앞(front) 원소가 먼저 삭제됨 - insert된 순서대로 처리됨 - 스택과 달리 큐의 맨 앞 원소와 맨 뒤 원소를 가리키기 위한 두 개의 front와 rear 포인터가 필요 Q = [a0, a1, ..., an-1] # 큐의 구현 - front: delete할 때 사용 - rear: stack에서의 top과 같은 역할을하며 add할 때 사용 - front와 rear 포인터의 초기 값 = -1 ← 일반적으로 이렇게 설정 - 새..

# 순열 - 어떤 원소 n개를 나열할 때 순서가 다르면 다른 순열로 간주함 (1) 집합 {'a', 'b', 'c'}에 대하여 찾을 수 있는 모든 순열 > P = {(a, b, c), (a, c, b), (b, a, c), (b, c, a), (c, a, b), (c, b, a)} > 3P3 = 3 * 2 * 1 = 3! = 6 (2) 집합 {'a', 'b', 'c', 'd'}의 순열 > 4! = 24 > 24개의 순열은 4개의 그룹으로 나뉘어질 수 있음 a) (a, Perm(b, c, d)) b) (b, Perm(a, c, d)) c) (c, Perm(a, b, d)) d) (d, Perm(a, b, c)) > 하나의 원소를 고정하고 그 뒤에 원소의 수만 다른 순열을 나타내는 함수를 호출함 > ex) P..

# Polynomial A(x) = 3x^20 + 2x^5 + 4 - a sum of terms(항), ax^e (x: variable, a: coeffiecient(계수), e: exponent(지수)) # Operations of Polynomial ADT - Zero(): 다항식을 0으로 만듦 ::= return 다항식, p(x) = 0 - IsZero(poly): 다항식이 0인지 검사 ::= if(poly) return FALSE else return True - Coef(poly, expon): 다항식에서 지수가 expon인 계수를 반환 - Lead_Exp(poly): 다항식에서 가장 큰 차수(지수의 값)를 반환 - Attach(poly, coef, expon): 계수가 coef이고 지수..