Search:

Type: Posts; User: copeg

Search: Search took 0.11 seconds.

  1. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    a) Single file or single class? Are inner classes allowed? b) There are many ways to store a Graph, some of which are completely independent of object oriented programming (such as an adjacency...
  2. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    Think about how the current dfs method is working:


    1 Gets the node and adds to stack:
    2 finds the next unvisited neighbor
    3 if you've reached the max count: end
    4 else go to...
  3. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    This is up to you. I don't know how much experience you have had with graphs or graph traversal. If none, then perhaps take a step back and learn them a bit in a more simple context. But at the same...
  4. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    Yes! Together with a traversal/search algorithm (recursion seems the most obvious way to go about the search). My advice would be to write down in pseudo-code how you'd tackle this, first thinking...
  5. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    That's good right? Always fun to learn something new! A tree would work of course, but another tiny hint if you don't mind it: a tree doesn't allow for circular paths which, if you consider each...
  6. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    I suggest taking a step back and if you have not, draw the problem out on paper. If you want a tiny hint, scroll down to read the hint below. If not, don't keep reading (and let me know if you wish...
  7. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    Did you decide on a data structure? An algorithm? What is it and why?
  8. Thread: Tackling problem

    by copeg
    Replies
    29
    Views
    3,262

    Re: Tackling problem

    Break the problem down, as Norm said do some design work first. For example, think if there is any data structure you know of which looks similar to that of the picture (or could be used to store the...
Results 1 to 8 of 8