darek9576's Profile User Rating: ***--

Reputation: 198 Stalwart
Active Members
Active Posts:
1,668 (1.11 per day)
13-March 10
Profile Views:
Last Active:
User is offline Today, 03:04 PM

Previous Fields

Dream Kudos:
Icon   darek9576 has not set their status

Posts I've Made

  1. In Topic: Introduce Yourself

    Posted 1 Apr 2014

    So that means i need to be member of dreamincode, stackoverflow, bytes etc etc just to see someone have a similar problem to mine and use solution provided?
  2. In Topic: Pointer value not getting updated

    Posted 27 Mar 2014

    Ignore my previous reply. I have stepped through the code with pen and paper and i see that the leftChild is the local pointer. So how do i change the code so that the left child pointer is the actual pointer of roots left child.
  3. In Topic: Pointer value not getting updated

    Posted 27 Mar 2014

    Why is it a local variable?
    I will break it down and show you my thinking behind it and you can tell me where i am wrong.


    Let's imagine the code in main we are executing is:

    1) newNode created at memory address: 0xB (inside insert() method)
    2) root has been initialized at memory address: 0xA. (inside insert() method)
    3)calling insertNode(0xA, 0xB);
    5)inside insertNode():
    6)root is not NULL so we skip this
    7)the else if statement executes and we go inside
    8) Node* leftChild is pointing to meomry address 0xC (which is NULL for now).
    9!) We call insertNode(0xC, 0xB)

    10)0xC is NULL so the first if statement executes and we set pointer to point to newNode.

    Where am i missing it?
  4. In Topic: Pointer value not getting updated

    Posted 26 Mar 2014

    OK. I have tried again from scratch and now when i am inserting the first node it is working. When i try to insert the second node - with value 3 - the Node comes out as NULL.
    When calling recursively it is not getting updated. I have tried your suggestion and now i am passing pointer by reference but it still gives errors.

    Updated code:

  5. In Topic: LinkedList - infinite loop

    Posted 16 Mar 2014

    Thanks. I have fixed the code accordingly but now the program exits with an error code.
    It seems as if i go 1 Node too far in printing since it prints:


    Is my while loop in the printList() method correct?
    Updated code:

My Information

Member Title:
D.I.C Lover
Age Unknown
Birthday Unknown

Contact Information

Click here to e-mail me


darek9576 hasn't added any friends yet.


darek9576 has no profile comments yet. Why not say hello?