【问题标题】:Findig values of a binary tree, that can be divided by 3查找可以除以 3 的二叉树的值
【发布时间】:2022-06-16 23:05:58
【问题描述】:

我有一棵二叉树,其值为“values = [8,3,1,7,12,15]”。函数 count_divisible_by(3) 应该返回可以被 3 整除的值。即:3, 12,15

classNode(object):                                
  def __init__(self, value): 
     self.value = value        
     self.left = None
     self.right = None

Class Tree:
  def __init__(self):        
     self.root = None

  def count_divisible_by(divisor):
      # Your code here        
      pass

【问题讨论】:

  • 你有什么问题?

标签: python


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-10-12
  • 1970-01-01
相关资源
最近更新 更多