Complexity and Big O Notation - ISC Class 12 Computer Science Notes, Diagrams and Solved Questions
Measure algorithms by how their step counts grow with the input size: counting steps in methods, dominant terms and constants, best, average and worst cases, Big O notation, and the analysis of searching, sorting and solving linear equations.
In this chapter
Explain concrete complexity and choose the input size
Count the steps of loops and nested loops
Keep the dominant term and drop constants
Use Big O notation and its definition
Tell best, average and worst cases apart
Show why linear search is O(n) and binary search O(log n)
Analyse bubble, selection and insertion sort
Explain why solving n linear equations by elimination is O(n³)