Section 19.3 Big O Notation

• A major difference among searching algorithms is the amount of effort they require.

• Big O notation (p. 814) describes an algorithm’s efficiency in terms of the work required to solve a problem. For searching and sorting algorithms typically it depends on the number of elements in the data.

• An algorithm that’s O(1) does not necessarily require only one comparison (p. 815). It just means that the number of comparisons does not grow as the size of the array increases.

• An O(n) algorithm is referred to as having a linear run time (p. 815).

• Big O highlights dominant factors and ignores terms that become unimportant with high n values.

• Big O notation is concerned with the growth rate of algorithm run times, so ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.