Search:

Type: Posts; User: Harith

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    1,719

    What i was trying to do is, make a binary search...

    What i was trying to do is, make a binary search tree, ask user for input 6 times, and then ask the user what number he would like to search for in the binary tree, if that number is found, store 1...
  2. Replies
    6
    Views
    1,719

    I entered the code bellow it, to see if the value...

    I entered the code bellow it, to see if the value exists in the tree:

    follow = root;

    int s;
    printf("Enter a val: ");
    scanf(" %d",&s);

    int found = 0;
    ...
  3. Replies
    6
    Views
    1,719

    I tested it, but its not even waiting for me to...

    I tested it, but its not even waiting for me to enter value, number 3 is being displayed and then the program exists. i think compiler had problem, let me check again.
  4. Replies
    6
    Views
    1,719

    Binary search tree

    Hello guys,

    I was working with binary search tree and came up with the solution:


    #include<stdio.h>
    #include<stdlib.h>

    typedef struct data
    {
  5. Replies
    6
    Views
    655

    c - Why does a space in my scanf statement make a...

    c - Why does a space in my scanf statement make a difference? - Stack Overflow
  6. Replies
    6
    Views
    655

    Try this: scanf(" %[^\n]");. Notice the space...

    Try this:
    scanf(" %[^\n]");. Notice the space after opening quotes.
  7. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Okay, give me a hint which variables should I...

    Okay, give me a hint which variables should I make local?
    P.S I tried making all of them local and I had over 20 warnings.
  8. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    /* *Database for storing music cd. */ ...

    /*
    *Database for storing music cd.
    */

    #include<stdio.h>
    #include<ctype.h>
    #include<stdlib.h>
    #include<cs50.h>

    #define MAX 200 //max characters a user can enter
  9. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Thanks man.

    Thanks man.
  10. Replies
    5
    Views
    1,150

    Did I mention I have shorten the program? Give me...

    Did I mention I have shorten the program? Give me another reason to when to use global variables.
  11. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    And I just noticed that last number is not being...

    And I just noticed that last number is not being printed
  12. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    That's it!! Thanks alot! But please explain to me...

    That's it!! Thanks alot! But please explain to me why:

    while(head != NULL) didn't worked?
  13. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    But I am having the same result, what I want is...

    But I am having the same result, what I want is with the same node I can move forth and back, is this possible?
  14. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Ya, I know this method, just wanted to try the...

    Ya, I know this method, just wanted to try the next and previous method.
  15. Why don't you use the function qsort?? qsort -...

    Why don't you use the function qsort?? qsort - C++ Reference
  16. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Okay I did as you said: #include ...

    Okay I did as you said:

    #include<stdio.h>

    typedef struct node
    {
    int value;
    struct node *next;
    struct node *prev;
    }node;
  17. Replies
    5
    Views
    1,150

    Ow, didn't even notice that mistake. Thanks man,...

    Ow, didn't even notice that mistake. Thanks man, and I will try and make the comments more useful. And fname is global because many functions are using it. :)
  18. Replies
    5
    Views
    1,150

    Getting an error message!

    Hey,

    /*
    *Database for storing music cd.
    */

    #include<stdio.h>

    #define MAX 200 //max characters a user can enter
  19. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    #include typedef struct node { ...

    #include<stdio.h>

    typedef struct node
    {
    int value;
    struct node *next;
    struct node *prev;
    }node;

    int main(void)
  20. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    That's what I have done, haven't I?

    That's what I have done, haven't I?
  21. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Okay, I removed head->next->prev =...

    Okay, I removed
    head->next->prev = malloc(sizeof(node));, but still its not working.
  22. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Ya I changed so that head goes back where it...

    Ya I changed so that head goes back where it started from; printing out numbers in reverse order, and then print the numbers again from start to end.
  23. Thread: Linked lists

    by Harith
    Replies
    26
    Views
    4,928

    Linked lists

    Hello,
    I created a structure with two nodes in it, one that points to the next node and the other points to previous node:


    #include<stdio.h>

    typedef struct node
    {
    int ...
  24. Thread: Linked lists

    by Harith
    Replies
    20
    Views
    2,345

    Thanks man for all the help. I am doing good now,...

    Thanks man for all the help. I am doing good now, but am stuck at deleting node problem:

    #include<stdio.h>

    typedef struct node
    {
    int x;
    struct node *next;
    }node;
  25. Thread: Linked lists

    by Harith
    Replies
    20
    Views
    2,345

    Some other code I saw is really complex: ...

    Some other code I saw is really complex:


    #include<stdlib.h>
    #include<stdio.h>

    struct list_el {
    int val;
    struct list_el * next;
    };
Results 1 to 25 of 82
Page 1 of 4 1 2 3 4