SyntaxFix
Write A Post
Hire A Developer
Questions
Time complexity is O(E+V) instead of O(2E+V) because if the time complexity is n^2+2n+7 then it is written as O(n^2).
O(E+V)
O(2E+V)
Hence, O(2E+V) is written as O(E+V)
because difference between n^2 and n matters but not between n and 2n.