<commit_before>"""
 Problem 9
 Implementation, Tree
"""
import unittest
from Algorithm_and_Data_Structures_Review.binary_search_tree import BinaryTreeNode


def binary_search_tree_check(bst):
    node_bounds_stack = [(bst, float('inf'), float('-inf'))]
    while len(node_bounds_stack):
        current_node, upper_bound, lower_bound = node_bounds_stack.pop()
        if current_node.value > upper_bound or current_node.value < lower_bound:
            return False
        if current_node.left:
            node_bounds_stack.append((current_node.left, current_node.value, lower_bound))<commit_msg>Docs: Corrected problem description and changed the category<commit_after>"""
 Problem 9
 Greedy/Divide and Conquer, Tree
"""
import unittest
from Algorithm_and_Data_Structures_Review.binary_search_tree import BinaryTreeNode


def binary_search_tree_check(bst):
    node_bounds_stack = [(bst, float('inf'), float('-inf'))]
    while len(node_bounds_stack):
        current_node, upper_bound, lower_bound = node_bounds_stack.pop()
        if current_node.value > upper_bound or current_node.value < lower_bound:
            return False
        if current_node.left:
            node_bounds_stack.append((current_node.left, current_node.value, lower_bound))
{'fraction_non_alphanumeric': 0.08931419457735247, 'fraction_numerical': 0.001594896331738437, 'mean_word_length': 4.4803493449781655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5754571', 'n_tokens_mistral': 377, 'n_tokens_neox': 362, 'n_words': 80}