Algorithms and Programming 101 by @OKSoFar
English
Intermediário
❶ 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.
Descrição
Tags
30
Perguntas
3 min
Por pergunta
11:55
Tempo médio
4,2
Pontos no Concurso
12
Participantes
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).