Thread: Help needed: Graph tracersal output passed to tree traversal code

  1. #1
    Registered User abady's Avatar
    Join Date
    Mar 2014
    Posts
    5

    Question Help needed: Graph tracersal output passed to tree traversal code

    Hi all!

    I'm veeeery new to C++. and honestly, I thought a lot before putting this post due to some comments I read in this forum which made me a little bit worried that I might receive some (let say) half answer(s) or a "punch to the face" replies, sorry to say that it is I'm really worried that I would receive a reply that would make me unmotivated to work on programming. Anyhow, I hope the message is clear.

    Let us cut to the chase. I would like to know how would I pass a graph or state from a graph (either DFS or BFS is used) to a binary tree which would be also producing a state to be used in a Simulated Annealing algorithm. In other words, first phase, graph traversal, second, tree traversal. And finally, Simulated Annealing. Would it be possible to pass a state from the graph to the tree then finally so the Simulated Annealing algorithm to check for a better solution?

    By the way, I already found a BFS code and also found a binary tree code, still cannot figure how to pass the graph to the tree though.

    Important note: I would like to note again that my knowledge of C++ and it's terminology is not much, please try to use simple terms or explanation when replying if possible, your suggestion is much appreciated
    Last edited by abady; 03-24-2014 at 07:01 PM. Reason: editting

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,530
    What you need is some solid book time to actually learn a few things about the language.
    C++ Book Recommendations
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User abady's Avatar
    Join Date
    Mar 2014
    Posts
    5
    Thank you for your reply, actually I searched and looked, why would I ask you here if I could search in books? I wanted a quick answer to lead me, I'm lost I need help and books is misleading me more, books do not give a quick answer (yes or no) they take a huge turn until one reach an answer.

    I will repeat again in plain English to Mr. Salem and to others, this website is suppose to be experts supporting newbies, and I need help, I'm lost in C++, I'm reading without understanding much and I need a second opinion. Please help me with little explanation if you got time. Thank you.

    Regards

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,530
    Help is offered (for free I might add) on the basis that there is at least some proximity between what the asker already knows and the scope of the question being asked.
    Say for example the relatively small step of writing to a file instead of writing to the screen.

    This approach (on our part) precludes wanting to help people who roll in with a mass of code they "found" on the web without a clue as to what to do next.

    You see, when there is a huge disparity between "what you know and what you want", filling that void is all but guaranteed to be an open ended time sink. We could collectively spend weeks on you and not get anywhere, and all the while more deserving people with better questions get a 2nd rate service.

    In short, what you need to do is put your graph traversal problem to one side for a month or two, while you get all clued up on the basics of C++ programming. If you've got specific questions about your learning, then we'll be more than happy to help.

    Drip feeding you the bits of the language which might help you solve the problem will largely be a waste of time, and it won't make you a programmer.

    There is no short-cut to what you want to achieve (despite your pleas for "yes or no" answers) . If you want to do the bulk of this work yourself (excepting the code you already found), then you need to buckle down and do some learning.

    Your other approach is to post the assignment on the Projects and job recruitment forum, and be prepared to hand over some $$$ to compensate people for their time and effort.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User abady's Avatar
    Join Date
    Mar 2014
    Posts
    5
    Thank you Salem message received mate, it means "go out! I will not help you out any further!". Thanks mate appreciate it, I will try to manage, but next time man if you don't feel like helping me out do not reply I'm not forcing your hand to do so either you do it or not mate, just be cool when you reply XD.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. b tree traversal
    By M Azhar Khan in forum C++ Programming
    Replies: 3
    Last Post: 10-23-2008, 01:41 PM
  2. Tree traversal
    By recluse in forum C Programming
    Replies: 4
    Last Post: 12-05-2004, 04:00 PM
  3. Replies: 5
    Last Post: 05-23-2003, 01:11 PM
  4. graph traversal
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 04-10-2002, 11:47 AM

Tags for this Thread