Answer:
False ( A )
Explanation:
The implementation is incorrect hence the return would be false and this is because : root.left is supposed to be NULL, root.right is supposed to be NULL and when these conditions are met then the Binary tree would be empty.
The condition for the above statement would be represented as
if( root.left = = null && root.right == null &&root.info == null)
return true;
else
return false;
Answer:
def length( mystring):
count = 0
for i in mystring:
count += 1
return count
def reversed( mystring):
strlist = []
for i in range(length(mystring)):
strlist.append(mystring[(length(mystring) - 1) - i])
txt = "".join(strlist)
return txt
string = 'Yolanda'
print(reversed(string))
Explanation:
The python module defines two functions 'reversed' and 'length'. The length function counts the number of characters in a string variable while the reversed function reverses the string variable value.
Complete question :
Sue is planning a theme park trip for her husband, herself, and her three children. She has a budget of $500. Adult tickets cost $55 each, and child tickets cost $25 each. Which formula should go in cell B4?
Answer:
=E1B1+E2B2
Explanation:
Cost of adult ticket = $55
Child ticket = $25
Number of adult = 2
Number of children = 3
Assume :
Cost of adult ticket = $55 = E1
Child ticket = $25 = E2
Number of adult = 2 = B1
Number of children = 3 = B2
The formula that should go into cell B5 in other to calculate total amount :
Total should be :
($55*2) + ($25*3)
=E1B1+E2B2
Answer:
Usually good and evil are depicted as black and white or red and white. White being good, or pure.
Explanation:
Answer:
function sum(number) {
if (number == 1) {
return 1;
}
return number + sum(number -1);
}
Explanation:
This is a recursive function, it means that is a function that calls itself for example: if you call the function with sum(5) the process is :
sum(5)
|______ 5 + sum(4)
|_______ 4 + sum(3)
|______ 3 + sum(2)
|_____2 + sum(1)
|_____ 1
the result is 1+2+3+4+5 = 15