Thread: Undirected graph and Binary Tree problem

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    3

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

  2. #2
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    From what i understand this is two separates assignment.
    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.
    I hate real numbers.

  3. #3
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    3
    Thanks for great help...that seems to me enough to complete it. Thank you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to use C++ graphs?
    By eur0dad in forum C++ Programming
    Replies: 4
    Last Post: 10-14-2006, 11:37 AM