Home > Back-end >  Linked list data structure part of the problem
Linked list data structure part of the problem

Time:12-01

Why is the book says NextElem execution time of O (1), and PriorElem execution time is O (n)?
I saw the two algorithm implementation, the worst case, the time complexity is O (Length), which is O (n), why do you say NextElem time complexity is O (1)? Time complexity is not the worst?
Algorithm from: https://blog.csdn.net/gy99csdn/article/details/82824737
  • Related