Search:

Type: Posts; User: peripatein

Search: Search took 0.01 seconds.

  1. But I was no longer referring to #7. I was...

    But I was no longer referring to #7. I was referring to #1 and to ways which might render it not necessarily clearer, but more sophisticated. Perhaps coming up with a better algorithm altogether. Can...
  2. But other than that, can you come up with a more...

    But other than that, can you come up with a more elegant/sophisticated code to yield the same output?
    Preferably shorter!
  3. I could have used more variables, agreed. But how...

    I could have used more variables, agreed. But how may I improve the function I opened this thread with?
  4. It is given that in this section the tree could...

    It is given that in this section the tree could not be empty.
    I first coded it thus, but figured my above code suited better. What do you think?


    int findMaxDepth(Node * tree){
    if (!tree)...
  5. depth 0. I have tried your code and it gave 7...

    depth 0. I have tried your code and it gave 7 where it supposed to have given 6 (and whereas my code gave 6).
  6. But that returns maxdepth + 1, and not the actual...

    But that returns maxdepth + 1, and not the actual maxdepth.
  7. Recursion for the ACTUAL maximum depth of a BT.

    Hi,
    I wrote the following function to determine the maximum depth of a binary tree, but it feels somewhat cumbersome to me. I'd truly appreciate it if you could help me improve it (make it shorter...
Results 1 to 7 of 7