Search:

Type: Posts; User: vart

Search: Search took 0.05 seconds.

  1. Replies
    39
    Views
    21,337

    Your case #1 and #3- D case has problems A...

    Your case #1 and #3- D case has problems


    A
    / \
    B C
    \
    D

    try to delete A and see what will happen?
  2. Replies
    39
    Views
    21,337

    if prevPtr->leftTree == currPtr it means you...

    if prevPtr->leftTree == currPtr

    it means you are on the LEFT side of the parent

    if prevPtr->rightTree == currPtr

    it means you are on the RIGHT side of the parent
  3. Replies
    39
    Views
    21,337

    so? it means...

    so? it means...
  4. Replies
    39
    Views
    21,337

    what will be the value of A->leftTree pointer?

    what will be the value of A->leftTree pointer?
  5. Replies
    39
    Views
    21,337

    why do you think parent will have 1 child? ...

    why do you think parent will have 1 child?


    A
    / \
    B C
    / \
    D E

    if I want to delete B - parent has 2 childs, settign both pointers to NULL will leak CDE
  6. Replies
    39
    Views
    21,337

    if your node is not present in the tree - your...

    if your node is not present in the tree - your function will crash

    when you deleting leaf - why do you set to NULL both pointers of the father? you delete only one child - second is leaked

    also...
  7. Replies
    39
    Views
    21,337

    no, adresses are per process

    no, adresses are per process
  8. Replies
    39
    Views
    21,337

    pure luck

    pure luck
  9. Replies
    39
    Views
    21,337

    How do you know it? memory does not belongs to...

    How do you know it?
    memory does not belongs to your program - it is returned to the memory pool...

    if this free just returned the last chunk of the memory in some page - the whole page could be...
Results 1 to 9 of 9