Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Mathematics is the backbone of DSA. Understanding basic formulas and concepts can help you solve complex problems with simple logic.
Sum = n/2 * (2a + (n-1)d)Sum = a(rⁿ - 1)/(r - 1)nPr = n! / (n-r)!nCr = n! / (r!(n-r)!)Many problems that look like they require loops can be solved in **O(1)** using a mathematical formula. Always look for a mathematical pattern before you start coding.