Is this algorithm right or how shall I write it?

*
*

*
*

*Construct an algorithm **Intern(**x**)**, which returns the number of
internal nodes in the tree. *

* *

Algorithm Intern(x)



1: if (x = nil) then

2:      return 0

3: else

4:      return 1 + Intern(left[x]) + Intern(right[x])

5: end if



 *a   -    **Give the time complexity/Running time of your solution in **O**
-notation. *

-- 
Med Venlig Hilsen/Kind regards

Rose

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to