Search:

Type: Posts; User: Shyam Raj

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,427

    I wrote a BST program recently which seems to...

    I wrote a BST program recently which seems to work fine. Its here: http://cboard.cprogramming.com/c-programming/152738-need-help-bst-program-2.html

    Salem, if you could verify the delete operation...
  2. Replies
    20
    Views
    2,266

    Salem: Thanks for the suggestion on the recursive...

    Salem: Thanks for the suggestion on the recursive code. Honestly am a bit weak with recursion, hence I chose the iterative method.

    The code that I posted earlier, did not give me any warnings like...
  3. Replies
    20
    Views
    2,266

    Thanks Salem, for your reply. I couldn't find out...

    Thanks Salem, for your reply. I couldn't find out how to do it the recursive way, hence I tried the iteration method and now it seems to work fine. Here's the updated code of findNode().


    int...
  4. Replies
    20
    Views
    2,266

    Hello, I've completed my program but there seems...

    Hello, I've completed my program but there seems to be some minor issue which I've been trying hard to figure out. Here's the code:


    #include<stdio.h>
    #include<conio.h>
    #include<stdlib.h>...
  5. Replies
    20
    Views
    2,266

    Thanks Salem, its working. I'm making some...

    Thanks Salem, its working. I'm making some modifications in the program to make it work my way. If I have any issues, I'll get back.

    Thanks again.
  6. Replies
    20
    Views
    2,266

    I could only understand a bit of your previous...

    I could only understand a bit of your previous comment. If you can give me some hint, I'll try it out myself.

    I've been stuck up with this for the past 5 days.
  7. Replies
    20
    Views
    2,266

    Hi Salem, I understand what you're saying. The...

    Hi Salem, I understand what you're saying. The addNode()function returns a NODE type and am not storing it. But I am not sure what do I assign it to.

    If I do it this way
    tree->root =...
  8. Replies
    20
    Views
    2,266

    Hi Salem, I changed the code a bit, I guess it...

    Hi Salem, I changed the code a bit, I guess it works fine but it doesn't print the output:

    The changed code is like this:


    #include<stdio.h>
    #include<conio.h>
    #include<stdlib.h>
    typedef...
  9. Replies
    20
    Views
    2,266

    @anduril462: Rightly said mate, there were a few...

    @anduril462: Rightly said mate, there were a few errors which i corrected. And as you said, the problem is definitely in the else part of addNode function, but I don't know how to assign that...
  10. Replies
    20
    Views
    2,266

    I removed the pointer to integer from all places...

    I removed the pointer to integer from all places and replaced with integer variables. I feel, the problem really lies in the way insertNode() is defined and called. In the else part of addNode()...
  11. Replies
    20
    Views
    2,266

    Need help with BST Program

    Hello All, I'm learning about BST from a book and I'm stuck half way while trying to code a BST. Here's my code:


    #include<stdio.h>
    #include<conio.h>
    #include<stdlib.h>
    typedef struct node
    {...
  12. Replies
    15
    Views
    2,362

    @root: Hello root, thanks for your detailed...

    @root: Hello root, thanks for your detailed reply. Regarding the array implementation of stack, I do have an idea that stacks can be implemented that way - however I haven't tried it yet bcoz I want...
  13. Replies
    15
    Views
    2,362

    @Andreas - By specifying a void pointer, we can...

    @Andreas - By specifying a void pointer, we can push an element of any type isn't it? Like a char/int/float. The program needn't be changed everytime. That was the idea behind this. Is it wrong?
  14. Replies
    15
    Views
    2,362

    @root - you said try using a recursive function...

    @root - you said try using a recursive function to print the stack, and I think I've done it that way. How else can the stack be printed?
  15. Replies
    15
    Views
    2,362

    Andreas and root: Thanks for your comments: I...

    Andreas and root: Thanks for your comments: I modified it and now it's working fine. Below is the code:


    void print(STACK_NODE *temp)
    {
    if(temp == NULL)
    {
    return;
    ...
  16. Replies
    15
    Views
    2,362

    Can someone else help me with this?

    Can someone else help me with this?
  17. Replies
    15
    Views
    2,362

    @christop - That's exactly what I thought. But I...

    @christop - That's exactly what I thought. But I know no other way to print the stack. Any help on this one?
  18. Replies
    15
    Views
    2,362

    Need a little help with printing a stack

    Hello, I've been learning stack ADT from one of the books and I've written the following stack programs which works fine if the "print(stack)" is called after "popStack(stack)."

    However if I call...
  19. Replies
    2
    Views
    659

    Thanks Salem, figured it out. :)

    Thanks Salem, figured it out. :)
  20. Replies
    2
    Views
    659

    What's wrong with this piece of code?

    Here's the code:


    #include<stdio.h>
    #include<conio.h>
    struct node
    {
    int data;
    struct node *next;
    }
  21. Thanks grumpy, I understood that now... :) :) ...

    Thanks grumpy, I understood that now... :) :)

    And thanks Salem as well :).
  22. Need help understanding swapping of integers

    Edit: Apologies, thread should have been named as "Need help understanding swapping of characters"

    Hello All,

    I found a program on the internet that gets all possible combinations of a given...
  23. Replies
    7
    Views
    1,189

    Hi qny, I understood what you said. Thanks for...

    Hi qny, I understood what you said. Thanks for that.

    Salem, why is that we need to add a leading space? Why doesn't it work the way I tried?
  24. Replies
    7
    Views
    1,189

    Unable to scan a character repeatedly

    Here's the code I wrote:


    #include<stdio.h>
    #include<conio.h>
    void initialize(int array[9][9])
    {
    int i = 0, j = 0;
    for(i = 0; i < 9; i++)
    {
  25. Replies
    6
    Views
    1,955

    Thanks grumpy, I understood that explanation. ...

    Thanks grumpy, I understood that explanation.

    Cheers. :)
Results 1 to 25 of 32
Page 1 of 2 1 2