javascript-algorithms
javascript-algorithms copied to clipboard
Traverse in Reverse is unnecessary complex
The current implementation has time complexity O(n^2)
. It could be improved to O(n)
by using recursion. I think it would be beneficial to have both approaches as it is the classic dilemma time vs. memory optimization.
nb
@ivancho-ifa which algorithm?
which algorithm
Guys, I believe this issue is about the reverse traversal of a Linkedlist Datastructure.