Given a graph, each node also has a value that defines it's priority in the connected component, you have to return top k high priority nodes.
eg (node, k) will return k high priority nodes in that connected component.
pros:
- I was able to understand the question and solve it before time.
- Provided time (nlogn) and space complexity O(N*E)
- Produced clean code with class and fun
cons:
- I did not handle the edge case where node is not present in the graph
- The interviewer asked me to dry run it and then I dry run the code
Can I expect to get a call for onsite interviews?
Comments (5)


