Interview Question






Comment hidden because of low score. Click to expand.
1
of 1 vote

warshall transitive closure

- Anonymous November 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

hey guys ..i think we can do by des steps.
1) build depth first trees
2) at each step find the next neighbour for those node which are connected to previous one and d the same till n.

- geek October 03, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

and for undirected graphs...?

- Anonymous November 02, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Do we really need transitive closures for this one?. I mean i=the question is asking about nth neighbor..so cant we extract that information from adjacency matrix itself?
A B C D . . Z
A
B
C
D
.
.
.Z

So, for each row, we need to find out the nth entry that has a '1' marked on it and if it is available then return the corresponding column vertex.

Also, I dont see any modification needed for directed graph.

In case im mistaken,...please do correct me!.

Thanks,
Pavan.

- Pavan Dittakavi August 18, 2012 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More