Complexity theory is a mathematical discipline that classifies computational problems by relative difficulty and measures the computational resources needed to solve them.