« first day (139 days earlier)      last day (16 days later) » 

8:44 PM
I understood it. maximally lines 6..10 can be executed 2m times, which is the amount of edges in the graph. But I don't understand why the time for line 6..10 is in $\theta(n)$. Is it because we are looking at node w of the graph, and we have potentially n of them? — imbAF 16 mins ago
Thanks for the feedback. Yes, it should have been count/6.
The time it takes to run line 6..10 once is mostly spent on running lines 7..9 for |V|=n$ times. It takes Θ(1) time to run lines 7..9. Hence the time it takes to run line 6..10 is nΘ(1)=Θ(n). In other words, it is "because we are looking at node w of the graph, and we have n of them", as you have pointed out.
 
@JohnL. Thank you for your answer
 
"maximally lines 6..10 can be executed 2m times". The usage of "maximally" here is confusing. The number of times lines 6..10 will be executed is always 2m.
 
But that depends
from the nr. of edges
oh right
the nr. of edges=2m always, no matter how many edges you have
Ok, and one additional question. Is this how you find time complexities usually when looking at pseudo codes, by doing that eq, that you just did? Is there like an intuitive / graphic way that you could have deduced this ?
 
9:05 PM
Yes. A guideline is to find the heaviest loop, then we know running time ≈ (number of times loop will be executed) X (time(loop body)). Since programming and looping is so universal, you will develop relevant intuition soon.
 
I see
The problem is that I have to give Algorithmic in Uni, and I am from Physics department, so to me algorithmic it looks to a certain degree, a deep dive into combinatorics and logic, and I simply cannot process fast enough what needs to be done
because I guess, problems in algorithmic, are not the ones I am used to solve. Puzzle like ones, i'd say
May I come here and ask questions in the future ?
 

« first day (139 days earlier)      last day (16 days later) »