
Originally Posted by
BlasW
To speak about cubic, quadratic etc. you have to define a function of what argument you are going to use.
For example, complexity of graph algorithms is often dependent from both number of vertices and edges in the graph.
If you are interested in just examples of code consider searching for sorting algorithms. Bubble soft and insertion sort are quadratic. Merge sort and quick sort are n log n. Bucket sort is linear, but needs additional memory. You can find code for these algorithms in Wikipedia.