Question
Complete the recursive search function for a Binary
Search Tree (BST). class Node:   def __init__(self, data):     self.data = data     self.left = None     self.right = None def search(root, key):   if root is None or root.data == key:     return root   if key < root.data:     _________ # Line to complete (search left subtree)   else:     _________ # Line to complete (search right subtree)Solution
The correct answer is A
In a lottery, there are 6 prizes and 30 blanks. A lottery is drawn at random. What is the probability of getting a prize?
- There are five Rs. 1 coins, four Rs. 2 coins, and fifteen Rs. 5 coins in a pouch. One coin is lost. Find the probability that the lost coin is not a Rs. 1 ...
A bag contains 12 white and some black balls. If the probability of drawing a black ball from the bag is thrice that of drawing a white ball, fin...
In a bag, there are four different colour of balls namely Red, Blue, Green and Yellow. The ratio between the number of blue and yellow balls in the bag ...
The probability that Leah will be accepted into program P is 60% and into program Q is 40%. Leah prefers program 'P' first, then 'Q', and finally 'R'. A...
John bought a watch for Rs. 3,400 and sold it at a profit percentage equal to the profit percentage earned on selling 10 bicycles for the cost price of ...
R goes to the gym either by cycle, car, or walking. On a specific day, the probability of him going by car is 0.3 less than the probability of walking a...
A box contains 10 red balls, 12 green balls, and 8 blue balls. Two balls are drawn at random. What is the probability that both balls drawn are either r...
A box contains only three colors of balls- red, green and blue. What is the minimum number of balls that should be picked from the box to ensure that at...
- The probability that Kunal passes an exam is (5/11) and the probability that Tanya fails is (3/7). If both write the exam, what is the probability that the...