Learn Big O Notation once and for all
AI summary of the linked articleThe article is a refresher on Big O notation, written by a developer who stumbled through a live coding interview question about the complexity of their solution and wanted a summary to review before future interviews. It explains that Big O describes how an algorithm's run time or space grows with input size n, and that constant factors are dropped, so an algorithm that touches each item twice is still O(n). Examples cover O(1) for accessing the first array element, O(n) for finding a maximum value, O(n^2) and O(n*m) for dice combinations, O(log n) for binary search, O(n log n) for merge sort, and O(2^n) for naive recursive Fibonacci. The author credits NeetCode for the material. |
Recommended by 1 curator |
Comments No comments yetWhat caught your eye? Start the discussion. |
More from dev.to on Kiwi News |
