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).