Algorithms and Programming 101 by @OKSoFar
English
Середній
❶ Before you hit 'start', please keep a pen and a paper ready, some questions may require you to work out a solution. ❷ As soon as you answer a question, timer for the next question starts. So, DO NOT spend time on the explanation, you can look it up anytime later using the 'lamp' button. ❸ Channel @OKSoFar has a list of more such quizzes, do check them out.
Опис
Теги
30
Запитань
3 хв
На запитання
11:55
Середній час
4,2
Результат у конкурсі
12
Учасників
Educational explanations. 👍 Explanations cover why the correct answers are correct and why the wrong answers are wrong (when appropriate). E.g.: #q1, #q2, #q3 etc
I know about discovery time for DFS, but not for BFS. I think that such term doesn't exist. Is there some source where discovery time for BFS is described?
Your answer is O(nm), but I can do this in O(nlogn+mlogm) in following way: sort both sets in O(nlogn+mlogm) and then find intersection using one cycle through them in O(n+m).