input file issue

This is a discussion on input file issue within the C Programming forums, part of the General Programming Boards category; I was wondering that Do i have to pass only one file to the adjacency list. (Edge File) or two ...

  1. #1
    C++ Beginner !!!
    Join Date
    Jul 2010
    Posts
    96

    input file issue

    I was wondering that
    Do i have to pass only one file to the adjacency list. (Edge File)
    or two files to make it.(Node File , Edge File)

    Node File has just name of the vertices in the graphs.
    EDGE file has [Vertex 1 - Vertex2].
    can some put some tutorial link for some help with adjacency list.

    thanks.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    Why does one have anything to do with the other?

    Sure, if the data is in two files, and it seems obvious from looking at the two files that you're meant to read from them alternately, then that is what you should do.

    As for adjacency list, I would suggest you google, but you've already done that haven't you.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    C++ Beginner !!!
    Join Date
    Jul 2010
    Posts
    96
    hey I goggled it before putting on the forum.
    I have written my code (just one input file :Edge file).
    My second problem, How i should define an edge between two vertices.
    the structure `i use are :
    Code:
    struct adj_node // to make adjacency list
    {
      int *val1;
      int *val2;
      float *prob; 
      struct adj_node *adj_next;
    };
    
    struct node    // the graph that is read in
    {
      int *val1;
      int *val2;
      float *prob;
      struct adj_node *down;
      struct node *next; 
    };
    .
    Thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  3. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 03:49 PM
  4. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  5. open input file twice?
    By keithmolo in forum C++ Programming
    Replies: 4
    Last Post: 07-31-2003, 07:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21