I am very poor in calculating complexities.
Please some one let me know what is the complexity of the below program.
I actually want to write a program for finding the nth last element with 0(n) complexity.
but unable write, please give me some idea.
the below code works perfectly and i considered all the posibilities.
if list empty : returns zero if postion is < 0 : returns -2 if position is > no of elements in the list : returns -1
please mention if any other possibilities can be covered.