Quyidagi iterativ yechim O(n) davomiyligi bilan mavjud: ``python def count_nodes_iterative(root): if not root: return 0 stack = [ root ] count = 0 while len(stack) > 0: node = stack.pop() if not node: continue stack += [node.left, node.right] count += 1 return count ``` Ushbu dasturda hali hisoblanmagan barcha tugunlar `stack` o'zgaruvchisida saqlanadi.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence