Search:

Type: Posts; User: willm07

Search: Search took 0.01 seconds.

  1. Sorry, let me clarify. Each tree may or may...

    Sorry, let me clarify.

    Each tree may or may not have unique indices.

    If an index is unique, then it should appear in the sum.

    So basically the sum is an ordered list of unique indices and...
  2. Yes but recursion is using a stack which will...

    Yes but recursion is using a stack which will never be filled with all the data from the tree at the same time (as when a function finishes recursion, its value is removed) and therefore will never...
  3. Forgot to say.. index can only appear once for...

    Forgot to say.. index can only appear once for any value, and most indexes don't appear at all.

    So a typical tree might contain only 4,26,45 and 74, for example.

    Therefore an array...
  4. Traverse two binary search trees in order at the same time

    So the algorithm to traverse a binary search tree structure in C:



    typedef struct Node {
    int ind;
    int val;
    struct Node *left;
    struct Node *right;
    } Node;
  5. Replies
    17
    Views
    3,916

    Interesting replies, thanks for the insights. Now...

    Interesting replies, thanks for the insights. Now I get what's going on with memory in C.

    Thanks again all
  6. Replies
    17
    Views
    3,916

    Then how come the following code works? ...

    Then how come the following code works?



    char snRows[50], snCols[50];
    fscanf(FP, "%s %s", snRows, snCols);


    Also.. are all variables in C stored on the stack unless otherwise specified...
  7. Replies
    17
    Views
    3,916

    foxman, Thank you very much for your help,...

    foxman,

    Thank you very much for your help, that has fixed it. I think it was that before I was creating a pointer to a pointer to a pointer:

    (ie. *rows[] was an array of pointers to MLists and...
  8. Replies
    17
    Views
    3,916

    Thanks for the quick reply. OK.. this is the...

    Thanks for the quick reply.

    OK.. this is the function that creates the structure from a text file; outputs a pointer to a Matrix structure:



    Matrix *CreateFromFile(char *filename)
    {
    ...
  9. Replies
    17
    Views
    3,916

    Tricky pointer problem in C

    Hey Everyone

    I am having some trouble with pointers in my C program. I vaguely know how they work and I have read countless (very good) tutorials, such as the ones here:
    ...
Results 1 to 9 of 9