
[DS] Polynomial (다항식)
Study/Data Structure
2021. 8. 25. 23:57
# 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이고 지수..