Search:

Type: Posts; User: trancekid

Search: Search took 0.01 seconds.

  1. I realized the same thing after posting what I...

    I realized the same thing after posting what I did. After changing it too... (checked_malloc just checks to make sure there is enough memory to allocate)


    TreeNode *newNode(char *key) {...
  2. Binary Search Tree does not seem to be adding nodes correctly...

    Well earlier today I was having a problem reading the strings into an array. After that was fixed I spent the next 5 hours trying to get this binary tree set up but after fiddling with everything I...
  3. Ah! good idea! Updated that as well. Edit:...

    Ah! good idea!

    Updated that as well.

    Edit: hey I may have been a pain in the ass but at least I didn't post my assignment and ask someone to finish it all for me, yah? haha. Thansk again Mats...
  4. Thanks. I appreciate all of the advice. This...

    Thanks. I appreciate all of the advice. This was only the first part of the assignment, the real part is to set all this into a binary tree (I am using an AVL tree) and a hash table with options...
  5. for(j = 0; j < numWords-1; j++) { printf("%d:...

    for(j = 0; j < numWords-1; j++) {
    printf("&#37;d: %s ", j, wordArray[j]);
    free(wordArray[j]);
    }

    free(wordArray);
    return 0;


    That is exactly how I have had it since you first mentioned...
  6. well then duh it was right the second time I...

    well then duh it was right the second time I fixed it.


    for(j = 0; j < numWords-1; j++) {
    printf("%d: %s ", j, wordArray[j]);
    free(wordArray[j]);
    }

    free(wordArray);
    return 0;
  7. When I do this... printf("i=%d ...

    When I do this...



    printf("i=%d words=%d \n", i, numWords-1);
    for(j = 0; j < numWords-1; j++) {
    printf("%d: %s ", j, wordArray[j]);
    for( i = 0; i < strlen(wordArray[j]); i++)
    ...
  8. int main() { FILE *file; int numWords=0, i,...

    int main() {
    FILE *file;
    int numWords=0, i, j;
    char fileName[30], wordString[30];
    char **wordArray;
    printf("Enter the name of the file:");
    scanf("%s", fileName);

    file =...
  9. Well, I kind of thought it was that line for a...

    Well, I kind of thought it was that line for a while but I guess my reasoning has failed me yet again. Anyways...

    wordString is obviously the first, or next, word in the file. So I am allocating...
  10. reading strings from .txt and entering in an array

    I am trying to read a file of 500k+ words that will be entered into a binary search tree. First I am just trying to read these words into an array of strings but it does not seem to be working. ...
  11. anyone know what the gcc command is to declare...

    anyone know what the gcc command is to declare the typedef of PQEntry on the command line? I am currently typing:

    gcc -DPQEntry=customer bank.c MinPriorityQueue.c mcs360.c -Wall -o bank

    but it...
  12. haha mcs360 is the course. MCS = Math and...

    haha mcs360 is the course. MCS = Math and Computer Science, the course is just an introduction to data structures. The prof gave us MCS360.c/.h which includes a version of checked_malloc/realloc...
  13. MinPriority Queue and structures, assistance needed :)

    I am in a C programming class and our current assignment is to write a program that will simulate the number of customers entering the bank and how long each takes to be served based on a Poisson...
  14. Replies
    2
    Views
    1,581

    Ah! it seems so obvious, but at the same time...

    Ah! it seems so obvious, but at the same time obviously it was not since I spent a lot of time getting frustrated with it. I really appreciate the help, it works perfectly now.
  15. Replies
    2
    Views
    1,581

    problem I am having with fscanf()

    Well I am trying to write a program for a class and part of it I will have to scan in information that is supposed to represent a maze. This information is included in a txt file (example below) and...
Results 1 to 15 of 15