SyntaxFix
Write A Post
Hire A Developer
Questions
O(n), because you traverse each node once. Or rather - the amount of work you do for each node is constant (does not depend on the rest of the nodes).
O(n)