Skip to content

Glossary: Data Structures and Algorithms in Java

Big-O shapes (O(1), O(log n), O(n), O(n log n), O(n²), O(V + E))

Also written: O(1), constant time, O(log n), logarithmic time, log n, O(n), linear time, O(n log n), O(n²), quadratic time, O(V + E)

The common growth rates: O(1) constant (same steps at any size), O(log n) halving each step (about 20 for a million items), O(n) linear (twice the data, twice the work), O(n log n) a good sort, O(n²) usually a loop inside a loop, and O(V + E) for BFS and DFS on a graph with V vertices and E edges.

Where the book teaches it

Related terms

Big-O notationamortized O(1)binary searchmerge sort