linear, quadratic and cubic algorithms
having just worked out the meaning behind what a cubic and quadratic algorithm is can anyone provide examples of these in code? I mostly know Java, and one example I know is nested 'for loops' where in quadratic form the structure would be a single for with a nested for and cubic being a for loop with a nested for and further nested for (phew...)......
would say a while loop with a for loop inside be considered quadratic? How about nested methods where a for loop calls another method which contains another for loop?