Just wanted to take this as my own notes from http://introcs.cs.princeton.edu/java/41analysis/ . Just take not that from Quadratic algorithm down below, aren't just that perfect algorithms that you would enjoy when handling large data structures. Complexity Description Examples 1 Constant algorithm does not depend on the input size. Execute one instruction a fixed number of times Arithmetic operations (+, -, *, /, %) Comparison operators (<, >, ==, !=) Variable declaration Assignment statement Invoking a method or function log N Logarithmic algorithm gets slightly slower as N grows. Whenever N doubles, the running time increases by a constant. Bits in binary representation of N Binary search Insert, delete into heap or BST N Linear algorithm is optimal if you need to process N inputs. Whenever N doubles, then so does the running time. Iterate over N elements Allocate array of size N Concatenate two string of length N N log N L...