__algo_buff__
BAN USER
Comments (6)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Yes, eugene.yarovoi is precise.
- __algo_buff__ September 24, 2013Comment hidden because of low score. Click to expand.
1
of 1 vote
Hey, DFS has O(V+E) complexity, but note that to run DFS, you need to build the graph. Building a graph for this problem takes O(n^2) complexity as you need to compare a person with every other person to determine whether they know each other. In other words, you will have to try n_choose_2 possibilities to establish the directed edges between nodes.
- __algo_buff__ September 24, 2013Comment hidden because of low score. Click to expand.
0
of 0 vote
Nice, but tricky to understand.
- __algo_buff__ September 24, 2013Comment hidden because of low score. Click to expand.
0
of 0 vote
Good one. But same as Jose's solution above.
- __algo_buff__ July 19, 2013Comment hidden because of low score. Click to expand.
0
of 0 vote
Good solution. But needs O(n) extra space.
- __algo_buff__ July 19, 2013Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
@Erasmus
- __algo_buff__ November 14, 2013Brilliant solution.
@@@@@@@
Nice example for Erasmus' solution.