Search:

Type: Posts; User: aim4sky

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    30
    Views
    6,595

    I think it is weird because for the CreateList,...

    I think it is weird because for the CreateList, it traverses fine after the program gets the item from the file and added into the list.

    Thank you very much for helping and explaining!
    I've...
  2. Replies
    30
    Views
    6,595

    Thank you very much!! Corret me if i'm worng....

    Thank you very much!!
    Corret me if i'm worng. The following code prints out the address of the pointer?


    printf("target = %p\n", (void *) targetnode);


    I have it working now. It's time to...
  3. Replies
    30
    Views
    6,595

    ahh...I have KeyType declared as: typedef...

    ahh...I have KeyType declared as:


    typedef char KeyType;


    When I change it to:


    typedef char KeyType[MAXCHAR];
  4. Replies
    30
    Views
    6,595

    Thank you for the help and explanations! Things...

    Thank you for the help and explanations! Things are a lot clearer now.

    TreeSearch():


    /* TreeSearch: search for target starting at node root.
    * Pre: The tree to which root points has been...
  5. Replies
    30
    Views
    6,595

    Yes, I forgot to add return root; The...

    Yes, I forgot to add


    return root;

    The complier didn't say anything about it. =/

    With that been added, the preorder is working now. So this means the items are inserted into the tree. ...
  6. Replies
    30
    Views
    6,595

    I changed the code to the way you stated and the...

    I changed the code to the way you stated and the problems are still there.
    When I search for an item that is in the input file, it gives me null.
    When I choose preorder, it gives me segmentation...
  7. Replies
    30
    Views
    6,595

    CreateTree: /* CreateTree: create a tree. ...

    CreateTree:


    /* CreateTree: create a tree.
    * Pre: None.
    * Post: An empty binary search tree has been created to which root points.
    */
    void CreateTree(TreeNode **root)
    {
    *root =...
  8. Replies
    30
    Views
    6,595

    Yes it is in the DoCommand(). I also have...

    Yes it is in the DoCommand(). I also have inorder and postorder in a similiar format to preorder in DoCommand().

    When I run the program after reading in the file and choose preorder. It gives me...
  9. Replies
    30
    Views
    6,595

    I used %s to print out the item's key in string....

    I used %s to print out the item's key in string.

    Where do I allocate the memory for all cases?
  10. Replies
    30
    Views
    6,595

    I did think that it was my printing function's...

    I did think that it was my printing function's problem but it i don't think it's the problem.

    printing function:


    void Print(TreeEntry x)
    {
    printf("%s\n", x.key);

    }
  11. Replies
    30
    Views
    6,595

    Binary Search Tree problem

    Hi, I am having a problem with my program. It does not insert anything to the tree. Any help are appreciated. Thanks in advance.

    driver:



    int main(void)
    {
    TreeNode *root;
  12. Replies
    20
    Views
    60,781

    Thank you tabstop and vart for helping!

    Thank you tabstop and vart for helping!
  13. Replies
    20
    Views
    60,781

    genlist.h #include #include...

    genlist.h


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include "common.h"


    #define MAXLIST 300
  14. Replies
    20
    Views
    60,781

    when I complie the following: #include...

    when I complie the following:


    #include "genlist.h"

    int main(void)
    {
    return 0;
    }
  15. Replies
    20
    Views
    60,781

    Thanks! I'll do that now.

    Thanks! I'll do that now.
  16. Replies
    20
    Views
    60,781

    The error I am getting is: cc -c -o radix.o...

    The error I am getting is:

    cc -c -o radix.o radix.c
    In file included from radix.c:12:
    queue_linked.h:20: error: storage class specified for parameter &#226;QueueEntry&#226;
    queue_linked.h:23: error:...
  17. Replies
    20
    Views
    60,781

    It was given.

    It was given.
  18. Replies
    20
    Views
    60,781

    Thanks! However, it is still producing the same...

    Thanks! However, it is still producing the same error. =/
  19. Replies
    20
    Views
    60,781

    I checked common.h. I don't see anything wrong...

    I checked common.h. I don't see anything wrong with it. =/

    common.h:


    //#define DEBUG // turns on debug


    // prevents multiple inclusions of header file
    #ifndef COMMON_H
  20. Replies
    20
    Views
    60,781

    Thanks, I'll work on that now and see if it goes...

    Thanks, I'll work on that now and see if it goes away.
  21. Replies
    20
    Views
    60,781

    The lines that the line numbers are pointing to...

    The lines that the line numbers are pointing to are in red.
    I don't understand what do you mean by hanging off the end of common.h?
    common.h is inside the quotation marks.




    //prevents...
  22. Replies
    20
    Views
    60,781

    error: storage class specified for parameter

    Hi, I am having this compiling error:

    queue_linked.h:18: error: storage class specified for parameter âQueueEntryâ
    queue_linked.h:21: error: expected specifier-qualifier-list before âQueueEntryâ...
  23. Replies
    9
    Views
    5,164

    Referring to #1: I was looking at other threads,...

    Referring to #1:
    I was looking at other threads, such as:
    http://cboard.cprogramming.com/showthread.php?t=100376

    it has

    currNode = (fileEntry*)malloc(sizeof(fileEntry));

    For #3,
    The...
  24. Replies
    9
    Views
    5,164

    First of all, thanks for the replies and help! ...

    First of all, thanks for the replies and help!

    I added a copy of the key in the Insert function. I have a warning from compliing.
    warning: assignment from incompatible pointer type (the line in...
  25. Replies
    9
    Views
    5,164

    Hi, thank you for helping. I allocate the key...

    Hi, thank you for helping.

    I allocate the key from fscanf?
Results 1 to 25 of 27
Page 1 of 2 1 2