0 0 votes why deleteQueue() is taking O(1) even if it has to traverse whole linked list ??? whereas deleteStack() has time complexity of O(n) ?? can anyone please explain it ? Programming in C + – akshayaK 856 views answer comment Share Follow Print See all 5 Comments 5 5 Comments reply Show 2 previous comments `JEET commented Nov 8, 2018 reply Follow flag This question needs further explanation. Like are you talking about the inbuilt functions or the functions made using linked list implementation of the queue? 0 0 replyShare Mk Utkarsh commented Nov 8, 2018 reply Follow flag ok then check the function DeleteQueue in that there is a while loop. So definitely not O(1), It's O(n) there is a misprint. 0 0 replyShare akshayaK commented Nov 8, 2018 reply Follow flag yaa, i was also thinking the same. but again i thought this might be some type of amortized analysis even though i dont understand what amortized analysis is. in deleteStack() => their are pointer operations, whereas in queue, they are just increementing pointer. may be this might effect overall analysis. or is it truly a misprint. 0 0 replyShare Please log in or register to add a comment.