Search:

Type: Posts; User: keepStriving

Search: Search took 0.13 seconds.

  1. Replies
    29
    Views
    3,258

    Re: Tackling problem

    Interesting, I have never used inner classes, definitely something I need to learn more about.
  2. Replies
    29
    Views
    3,258

    Re: Tackling problem

    On topcoder there are many problems that need to be solved by graphs, and since I can only create one class for a particular problem how can I solve these problems.
  3. Replies
    29
    Views
    3,258

    Single Class graphs

    How can graphs be represented in a single class?
    I know how to make a graph with several classes such as Vertex which defines the vertex, Stack which defines the Stack, Graph which lays out the...
  4. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I've managed to sort out that problem and can now get the correct values for all individual vertexes and their respective adjacencies, though when I try to count them all together I get an array out...
  5. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I have done the recursion to backtrack though don't understand your point here "but also note that as you backtrack nodes that were visited should marked as unvisited." Why would I do this as when I...
  6. Replies
    29
    Views
    3,258

    Re: Tackling problem

    This is what I have changed which allows me in the example of 2 to go through all adjacencies 1, 3 and 5 though when it is finished it keep repeating 2 till it gets an error. Why is it doing this?...
  7. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I have made progress though am stuck at a particular point for each vertex, I can only get it to dfs through one adjacency instead of all adjacencies. So for example the vertex 2 has the adjacencies...
  8. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I have no experience, it's the first time I've come across the graph data structure so getting somewhat frustrated by the problem though also really interested by the topic of graph theory, once I...
  9. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I know I need to do DFS which will stop by somehow stop when it reaches N.
    Do you think I should leave this problem and try to find easier problems to do with graphs as the more research I do the...
  10. Replies
    29
    Views
    3,258

    Re: Tackling problem

    public static long countPasswords(int N){

    boolean[][] adjacencyList = new boolean[10][10];


    for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
    if(i==0){
    if(j==7){...
  11. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I suppose graph is what you were trying to hint out to me which seems to fit right with the problem.
  12. Replies
    29
    Views
    3,258

    Re: Tackling problem

    Hopefully I'll try it with a tree some other time. I've decided to go with multidimensional array.
    So far this is the code, just missing the biggest piece in the puzzle which is to start going into...
  13. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I've set myself on the tree, though I'm unsure of how to implement a non binary tree in java, many resources I have come across say to create a separate tree class which I can't do. I have understood...
  14. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I chose a hash map which has a integer denoting the button pressed as a key, and an arraylist as a value which would show adjacencies that could then be accessed in turn. I'm stuck on what algorithm...
  15. Replies
    29
    Views
    3,258

    Re: Tackling problem

    I was using long for "i" instead of int.Sorted that.

    --- Update ---

    How do you think I can move forward with this problem?
  16. Replies
    29
    Views
    3,258

    Re: Tackling problem

    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Map;

    public class UnsealTheSafe {

    public static void main(String[] args){

    ...
  17. Replies
    29
    Views
    3,258

    Re: Tackling problem

    public class UnsealTheSafe {




    public long countPasswords(int N){

    for(int i = 0;i<N;i++){

    }
  18. Replies
    29
    Views
    3,258

    Tackling problem

    TopCoder Statistics - Problem Statement

    I was wondering if anyone could give me any tips on how to go about solving the following problem, the guide says that it is a dynamic programming problem,...
Results 1 to 18 of 18