# Undirected graph and Binary Tree problem

• 04-30-2008
arafat21
Undirected graph and Binary Tree problem
I unable to solve my assignment problem,come here to get some hint or help...to solve this:-

Let G=(V,E) bean undirected graph.Use depth-first search to develop a program using 'C' language to convert each edge in G to a directed edge such that the resulting graph is strongly connected,or determine that this is not possible.

Write a program in 'C' programming language to list the nodes of a binary tree in the following way: List the root,then nodes at depth 1,followed by nodes at depth 2, and so on.

Hope some guy may help me sort out this problem.
• 04-30-2008
foxman
From what i understand this is two separates assignment.
Quote:

Write a program in 'C' programming language to list the nodes of a binary tree in the following way: List the root,then nodes at depth 1,followed by nodes at depth 2, and so on.
This is simple; just do a breadth-first search starting from the root. If you need to know at which depth you are currently are before printing the value of the node, it's also fairly easy to do so.

As for the other assignment, it looks a bit more complex. In fact, i don't really know and i don't have any idea about how to solve it right now. Anyway, we aren't supposed to do your homework for you.
• 04-30-2008
Bleech
• 05-02-2008
arafat21
Thanks for great help...that seems to me enough to complete it. Thank you.